-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Child's Transform component ignored when parent does not have the GlobalTransform/Transform components #2277
Description
Bevy version
Operating system & version
Arch Linux
What you did
- Create an entity using just
spawn, i.e., withoutTransformandGlobalTransformcomponents. - Add a child using
spawn_bundleandPbrBundle, setting the mesh, material, and transform fields (use..Default::default()for the other fields)
What you expected to happen
Since the parent entity didn't have either a Transform or a GlobalTransform component, I would expect that the transform component in the child entity would be relative to the reference frame. If this had been the case, the transform_propagate_system should have set the GlobalTransform component according to the Transform component and the mesh should have been rendered at the offset provided in the PbrBundle.
What actually happened
The mesh renders at the origin (i.e., the transform field from the PbrBundle appears to have been ignored).
Additional information
From the query in the transform_propagate_system, it appears that this system does not handle the case where the parent entity doesn't have a GlobalTransform/Transform component, but it's children do. Is this behavior intentional?