Changing behaviour Tree doesn't call abort on current task

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.

Thanks for reporing this issue.

Fix is already on way. Your workaround should be safe to use, unless you have tasks that can delay their abort.

Glorious! Might this be included in 4.7 release?

No, it was found too late :confused:

Yes, workaround have to stay until 4.8.

: (

Sneak it in! It will be our secret…

In all seriousness, thanks anyway and mark this one answered I guess. We’ll use our workaround until, I assume, 4.8?

You haven’t fixed this in master yet correct?

Hi dzeligman,

Yes, this should be in Master. It was committed on 2/16 as CL#2446753.