Skip to content

Make Visibility affect children entities #3874

@nicopap

Description

@nicopap

What problem does this solve?

It's useful to "bulk" toggle the visibility of a group of entities.

What problems does it introduce?

User may want to toggle visibility of parent without affecting the visibility of the children. Typically, you might want some parent to become invisible while the children are still visible in cases where you also take advantage of parent/child relationship for Transform/GlobalTransform.

What solution would you like?

  • My best guess would be a ActualVisibility non-public component that is given to all children of Changed<Visibility> entities. This would also require updating the component on hierarchy changes.
  • To be able to decouple transform hierarchy from visibility hierarchy, it would be advisable to add a Inheritance component or as an additional field to Parent and Children that let the user select which property is inherited (as suggested by @alice-i-cecile ) Note: this might be worth it's own separate PR

What alternative(s) have you considered?

  • It might be possible to walk the hierarchy at render time to infer then whether to display or not the concerned entity.
  • Relations 🌈

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenA-UIGraphical user interfaces, styles, layouts, and widgetsC-FeatureA new feature, making something new possible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions