I’ll try to show my problem on a minimal example, in reality it’s more complex:
It’s a simple behaviour, that repeats “an action” that has a certain animation. If a player gets close, this sequence gets interrupted and the AI executes the “Flee” action.
The interruption happens because the top level selector is “dynamic” which in Unity/NodeCanvas means, that its higher priority nodes get executed every frame and if they succeed they interrupt the lower priority ones.
My problem is shown via the red arrow – if the “action” gets interrupted, the clean up (in this case “stop animation”) doesn’t execute.
What is the best practice to handle the clean up? Is my setup flawed? Or should I just be using a different interrupting mechanism?
Thanks for any help!