# BT conditional loop decorator

**URL:** <https://forums.unrealengine.com/t/bt-conditional-loop-decorator/341408>\
**Category:** AI\
**Tags:** Behavior-Tree, unreal-engine, Blueprint, question\
**Created:** [December 14, 2015, 8:24am UTC](https://forums.unrealengine.com/t/bt-conditional-loop-decorator/341408 "2015-12-14T08:24:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_66a0fcb6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_66a0fcb6](https://forums.unrealengine.com/u/anonymous_user_66a0fcb6)\
**Post date:** [December 14, 2015, 8:24am UTC](https://forums.unrealengine.com/t/bt-conditional-loop-decorator/341408/1 "2015-12-14T08:24:57Z")

</div>

Hello,

Today I was working on the AI and I noticed that a part of the tree which is under a conditional loop will execute once, even if the condition is false. I’m attaching a screenshot that shows the situation. The only reason I could think of is that the conditional loop decorator is a do while instead of a while.

In my case I wanted my bot to go back to a wandering state if he fails to attack the player within a certain amount of time. However that’s not what was happening. The branch of the tree was also being entered even though the condition was false (even the debug said “fail”).

 ![70500-bt+condition.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/e/b/9eb41a5dbacd4929b1831fbbf9fc03ae69d65bc8.png)
