Help Stopping Behavior Trees

At the moment what is the method of stopping behavior tree? It seems there are no ways to stop it via blueprint.

I’m aware of a similar thread discussing this,

however it seems that method discuss exposes the C++ function from the behavior tree component , i believe the original behavior tree in the earlier shooter game utilizes BT Component. After 4.3 it seems I believe Behavior tree is no longer being ran as component, correct? Hence how do we stop it now via blueprint ( Or C++ )

I’m not quite sure what you want to achieve. Do you mean you make AI use a BT and then you want it to stop? Why would you do that? If you want AI to do nothing in some circumstances just embed this behavior (not doing anything is a behavior as well!) into your behavior tree.

Alternatively you can have a BT asset like “BT_Dumb” that would make AI wait indefinitely.

Other than that there’s no blueprint way of literally stopping BT’s execution for a specific AI.

After 4.3 it seems I believe Behavior tree is no longer being ran as component, correct?

Wrong. Behavior Tree, the asset, is run for an AI by its UBehaviorTreeComponent instance.

If I misunderstood please let me know.

Cheers,

–mieszko

I’m actually attempting to stop the BT when the AI is dead. it seems that the BT continues to run regardless at the moment. Trying to do DestroyActor(via blueprint ) on AIController also does not work for some reason ( but that’s a separate issue ) .

Hence the BT continuosly run. I did make a check so that it indefinitely waits when the AI is dead, but the list of BT keeps getting bigger. I will attempt to do the C++ way of stopping BT Component.

Sorry about the UBehaviorTreeComponent mixup. I wasn’t aware it is still utilizing UBehaviorTreeComponent . As I noticed the old shootergame style manually adds BTComponent to the Controller and then points it to a BT and run it. Currently I’m running it directly from the Blueprint without adding component , hence I assume no component is involved.

1 Like