[SOLVED] Unsubscribe form events before leaving a scene

I have some entities in the scene that subscribe to some events of other entities of the same scene.
When I change the scene I destroy the root node of the scene. Do I need to unsubscribe all the events using the on destroy event itself?
I suppose that is not needed as all the objects will be removed anyway.
Is a quite big load of code that I could spare if it’s not needed.

When an entity is destroyed all event listeners attached on the entity get destroyed. If you destroy the root then you probably don’t have to clear events.

1 Like