Skip to content

Warn about broken hierarchies #5849

@asafigan

Description

@asafigan

What problem does this solve or what need does it fill?

Currently things like rendering require that every ancestor in a hierarchy have a set of components in order to work. Adding a child to a parent which doesn't have these components silently fails. For example, adding a entity with a PbrBundle to a parent that doesn't have a SpatialBundle causes the child not to be rendered. It can be confusing what the cause of the problem is.

What solution would you like?

On debug builds, warn that a child has SpatialBundle components but it's parent doesn't.

What alternative(s) have you considered?

Writing my own system to do this for me.

Additional context

A missing SpatialBundle wasted me an hour of time on Bevy Jam 2. A simple warning would have pointed out the issue to me immediately and saved me all that time and energy.

There are other issues that show this is a common foot gun: #2277, #5081

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-DiagnosticsLogging, crash handling, error reporting and performance analysisC-DocsAn addition or correction to our documentationC-UsabilityA targeted quality-of-life change that makes Bevy easier to use

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions