Skip to content

Child's Transform component ignored when parent does not have the GlobalTransform/Transform components #2277

@allsey87

Description

@allsey87

Bevy version

9f94f7e

Operating system & version

Arch Linux

What you did

  1. Create an entity using just spawn, i.e., without Transform and GlobalTransform components.
  2. Add a child using spawn_bundle and PbrBundle, 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsA-TransformTranslations, rotations and scalesC-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