Is there a way to run some actions/events when the object going to be destroyed?
Similar to the OnDestroy() that can be used from the C#?
I write a Script that send event to fsm
void OnDestroy() { fsm.SendEvent("Die"); } but unfortunately it does not work. I can send event onUpdate, for example, but can't see a result OnDestroy