Open
Description
Bevy version
0.16.0
What you did
Spawned a scene with a hierarchy where children are defined before parents, and all have a Transform
component.
What went wrong
This results in a false-positive warning like:
warning[B0004]: The `0vX` entity with the GlobalTransform component has a parent without GlobalTransform.
This happens because the check is implemented in this hook, which runs on insertion.
I think we should turn this check into a disableable system that iterates over entities with Added<C>
.
Temporary workaround
Users can create a separate component that, on insertion, adds ChildOf
using commands. This causes the check to be delayed until after all entities are spawned.
Additional information
This also happens with bevy_replicon
during replication when a child is processed before its parent.