# Help Stopping Behavior Trees

**URL:** <https://forums.unrealengine.com/t/help-stopping-behavior-trees/293951>\
**Category:** AI\
**Tags:** Behavior-Tree, unreal-engine, editor, UE4, CPP, Blueprint, question\
**Created:** [September 17, 2014, 5:44pm UTC](https://forums.unrealengine.com/t/help-stopping-behavior-trees/293951 "2014-09-17T17:44:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frozenfire](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Frozenfire](https://forums.unrealengine.com/u/Frozenfire)\
**Post date:** [September 17, 2014, 5:44pm UTC](https://forums.unrealengine.com/t/help-stopping-behavior-trees/293951/1 "2014-09-17T17:44:08Z")

</div>

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,

> **[How to stop/change a behavior tree using blueprints](https://forums.unrealengine.com/questions/57135/how-to-stopchange-a-behavior-tree-using-blueprints.html)**
>
> We are using the Run Behavior blueprint node to start a behavior tree in the AIController and that is working great, but I don’t see a way to stop a behavior tree from running using blueprints. I also don’t see a way to change the behavior tree that...

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++ )

---

<div class="post-metadata">

**Author:** ![MieszkoZ](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MieszkoZ](https://forums.unrealengine.com/u/MieszkoZ)\
**Post date:** [September 18, 2014, 12:39am UTC](https://forums.unrealengine.com/t/help-stopping-behavior-trees/293951/2 "2014-09-18T00:39:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Frozenfire](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Frozenfire](https://forums.unrealengine.com/u/Frozenfire)\
**Post date:** [September 18, 2014, 4:29am UTC](https://forums.unrealengine.com/t/help-stopping-behavior-trees/293951/3 "2014-09-18T04:29:24Z")

</div>

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.
