OnEnd() - how to tell when aborted

Sinbad3D

New member
I'm having a small issue: I want to know when my task was aborted by another task rather than completing itself. OnEnd() has no arguments, and NodeData.ExecutionStatus always returns TaskStatus.Running regardless of how the action was ended.

Obviously when I end my own task by returning Success/Failure its fine, but how can I tell whether my task is ending because of an abort?
 
There isn't a separate callback/parameter for this so you'd need to add a flag to your task to be able to tell. Something like setting the flag to true when you successfully return within OnUpdate, and then checking that flag within OnEnd.
 
Hmm I have a similar problem. My Fire task runs StartFiring through another component on start and keeps firing until the task succeds, and after a few seconds it calls a StopFiring. But if it gets aborted, for example if being hurt below a threshold, is there anything being called in the fire task or is it just abruptly aborted without any event?

Maybe something newly added since 2019?
 
Top