Changing current behaviour tree doesn’t cause current task to call its ReceiveAbort function. It means a task keeps running until completion when a behaviour tree is stopped. This causes problems when I want an enemy to stop all attacks while stunned and it keeps executing its last attack. And then being stunned.
Is this intended behaviour?.It feels wrong.
I can’t seem to work out when ReceiveAbort is ever supposed to be called either.
I fixed this by making AbortCurrentTask() in BehaviourTreeComponent public and adding a StopBehaviourTree function in AIController.cpp that calls this then StopTree() on current behaviour tree. But I’d rather not be running a custom version of UE4.