-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Warn about broken hierarchies #5849
Description
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