Skip to content

B0004 check sometimes triggers false positives #19776

Open
@Shatur

Description

@Shatur

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ScenesSerialized ECS data stored on the diskC-BugAn unexpected or incorrect behaviorS-Needs-DesignThis issue requires design work to think about how it would best be accomplished

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions