Skip to content

There is no viable alternative to HierarchyEvent #19019

Open
@Zeenobit

Description

@Zeenobit

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

With 0.16, it looks like HierarchyEvent was removed. Prior to 0.16, HierarchyEvent was the only way to reliably detect specific changes to a hierarchy.

I realize we have RemovedComponents. The problem with it is that it only tells you from which entities it was removed; it doesn't give you the component data.

So if I listen to RemovedComponent<ChildOf>, I won't know which parent the entity was removed from. I could listen to Changed<Children>, but what if Children gets removed? Then I'd have to also listen to RemovedComponents<Children>... and I'd still have the same issue as RemovedComponent<ChildOf>.

What solution would you like?

Either a RelationEvent to detect when relations change, or a way to access removed component data.

What alternative(s) have you considered?

Alternatively, I could use component hooks, but I believe having the ability to know when a specific relationship has ended between which exact entities at a system level is critical.

Additional context

This has also been brought up before:
#13925 (comment)
#17398 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleP-RegressionFunctionality that used to work but no longer does. Add a test for this!S-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