AI Behavior Tree not Aborting immediately when triggered

Hello everybody,

I’ve got a Behavior Tree issue that I can’t figure out. It’s not the BT it’s me, but I’m not sure how to get around this. So, I have an AI character. I right click on a resource and that triggers the BT to do its events (Shown in picture 1, the AI char moves to resource location, plays gather anim, then moves to storage building)…All of that works just fine.

pic1:

However, what I want is when the player clicks with the LMB anywhere I want ALL AI TASKS to abort immediately. Now, I have a blackboard key for that: “IsPerformingAITask”. When the player clicks the LMB, “IsPerformingAITask” gets set to false (as shown in picture 2). I also have a decorator (D_ManualAbortKeyChecK) that checks the value of “IsPerformingAITask”. Here’s my thinking with that decorator If the value is True, then carry on with the BT, if it is false, then stop.

pic2:
3090ff7862d68a41f3bb5e286589577bdfa8ef01.jpeg

The problem seems to be that once the decorator (D_ManualAbortKeyCheck) gets called and PASSES as TRUE, it doesn’t get called again and I have to wait for the whole BT to finish before the decorator gets checked again. But I think I want the decorator to be constantly checked so when it’s false it just stops execution of all of its children.

Does anybody have any advice of how to do this? Instead of doing a decorator do I just need to manually check the “IsPerformingAITask” in every task in the BT and abort it from the task if it’s false?

Just in case anybody is curious, the “D_ManualAbortKeyCheck” is pictured below:

3bcb1d5920a4222d2eacb609137bdb686d9e5ba0.jpeg

Thanks so much for any advice anyone has.

Cheers!

Actually looks like I figured it out. Whether or not this is the best way to do it I dunno, but it works so that’s good. If anybody sees anything that is ridiculously inefficient please I’m all ears as I’m still learning AI best practices.

The changes were just to add the T_Abort task and then also have the Decorator I made in the simple parallel.

Simple Parallel

New Abort Task
3555e58feb9b57b38c5c9f8dfa1fa455783f334a.jpeg