# Behavior Tree stuck at the root node

**URL:** <https://forums.unrealengine.com/t/behavior-tree-stuck-at-the-root-node/400791>\
**Category:** AI\
**Tags:** stuck, Behavior-Tree, unreal-engine, question\
**Created:** [July 28, 2017, 8:29am UTC](https://forums.unrealengine.com/t/behavior-tree-stuck-at-the-root-node/400791 "2017-07-28T08:29:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_53a5a456](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_53a5a456](https://forums.unrealengine.com/u/anonymous_user_53a5a456)\
**Post date:** [July 28, 2017, 8:29am UTC](https://forums.unrealengine.com/t/behavior-tree-stuck-at-the-root-node/400791/1 "2017-07-28T08:29:53Z")

</div>

The behavior tree gets stuck at the root node(yellow) and then the screen hangs due to large amount of memory usage. The tree is shown in the figure.

 ![203240-bt_not_woking.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/8/7/c87221bb9310cd16624cf897b59ff9365551fd76.png)

I am new to using the engine. Sorry if the question is not appropriate. The code was written in C++. I already searched a lot but didn’t find any solution. Thanks for the help.

---

<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:** [July 28, 2017, 9:51am UTC](https://forums.unrealengine.com/t/behavior-tree-stuck-at-the-root-node/400791/2 "2017-07-28T09:51:53Z")

</div>

The tree itself look good, so there must be something else going on. What’s the `Next Target Selection` task? How is it implemented? What does it do, and when?

> The code was written in C++

I assume you’re talking about the task node. Would you mind posting the sources?

Cheers,

–mieszko

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_53a5a456](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_53a5a456](https://forums.unrealengine.com/u/anonymous_user_53a5a456)\
**Post date:** [July 28, 2017, 11:18am UTC](https://forums.unrealengine.com/t/behavior-tree-stuck-at-the-root-node/400791/3 "2017-07-28T11:18:42Z")

</div>

Thanks for replying and yes I was talking about my task nodes.  
Basically the _Next Target Selection_ task selects a target from available list of TargetPoints that are in the level in case there are no **target** present. So it’s for wandering.  
It is implemented in a way that the character goes back and forth on a single line(made of target points).  
[Link](https://github.com/srishti-learner/Source/blob/master/BTTargetPointSelection.cpp) to the source. I would appreciate it if you can have a look.

---

<div class="post-metadata">

**Author:** ![mindblender](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mindblender/32/598567_2.png) [@mindblender](https://forums.unrealengine.com/u/mindblender)\
**Post date:** [May 28, 2025, 8:50pm UTC](https://forums.unrealengine.com/t/behavior-tree-stuck-at-the-root-node/400791/4 "2025-05-28T20:50:21Z")

</div>

I had the same issue. My issue was my incorrect implementation of BT Task. Simply put, I had to **add Abort Event that calls FinishAbort(false)** in order to fix this. I hope this helps anyone else visiting this post.
