OnTriggerExit not called for DetectObjectAbilityBase upon death


I have an ability (flying a bird) that uses the DetectObjectAbilityBase with a trigger. While the ability is active, the character is within the trigger collider. Now, if the character dies while the ability is active, the ability is stopped, and the character is respawned outside the trigger. But the OnTriggerExit method of the DetectObjectAbilityBase class is never called. As a result, the m_DetectedTriggerObjectsCount/m_DetectedTriggerObjects[] is not reset, and I can start the ability even the character is not within the trigger.

Regards, Christian


Staff member
Interesting, nice find, thanks - @Justin I believe this is a bug? For a temporary workaround, it should be easy enough to just listen to the OnDeath event within DetectObjectAbilityBase and remove the character from the array etc at that time.


Staff member
When the character dies the ability is going to be stopped. OnTriggerExit will not be called on an inactive ability. I'll need to think of the right way to handle this case because you could stop the ability while still being in the trigger while alive so I don't just want to clean everything up when it is stopped.