Skip to content

Visibility inheritance should ignore parents without a Visibility component #5616

@Alainx277

Description

@Alainx277

What problem does this solve or what need does it fill?

When creating a hierarchy of objects, where some of them have meshes but the root does not, the children will not render. This is due to the fact that the parent requires a VisibilityBundle so the children are visible_in_hierarchy.

What solution would you like?

If a parent entity doesn't specify any visibility, the direct descendants should automatically have visible_in_hierarchy set to true (currently false).

What alternative(s) have you considered?

Rely on the user to know every object in the hierarchy needs a VisibilityBundle so child objects are also visible. This means it has to be clearly documented and shown to beginners (similar to GlobalTransform).

As a personal anecdote: I've wasted quite some time debugging because I didn't know about this (as it is new in 0.8). I imagine many new-ish Bevy users will experience this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-UsabilityA targeted quality-of-life change that makes Bevy easier to useM-Needs-Migration-GuideA breaking change to Bevy's public API that needs to be noted in a migration guide

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions