# Behaviour Tree Cooldown Decorator locks out task indefinitly

**URL:** <https://forums.unrealengine.com/t/behaviour-tree-cooldown-decorator-locks-out-task-indefinitly/385219>\
**Category:** AI\
**Tags:** Behavior-Tree, decorator, unreal-engine, question\
**Created:** [February 17, 2017, 8:51am UTC](https://forums.unrealengine.com/t/behaviour-tree-cooldown-decorator-locks-out-task-indefinitly/385219 "2017-02-17T08:51:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dinomannen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dinomannen](https://forums.unrealengine.com/u/Dinomannen)\
**Post date:** [February 17, 2017, 8:51am UTC](https://forums.unrealengine.com/t/behaviour-tree-cooldown-decorator-locks-out-task-indefinitly/385219/1 "2017-02-17T08:51:12Z")

</div>

I have a simple parallel running a main task (move to) with a task blueprint running in the background. The background task loops by itself on completion, however since the task is completed very fast it loops to often. I thought i could solve this by adding a Cooldown decorator to the task, but this prevents it from firing more than once until the main task is completed.

[https://puu.sh/u6ZAy/7513ceb515.png](https://puu.sh/u6ZAy/7513ceb515.png)

---

<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:** [February 17, 2017, 1:44pm UTC](https://forums.unrealengine.com/t/behaviour-tree-cooldown-decorator-locks-out-task-indefinitly/385219/2 "2017-02-17T13:44:13Z")

</div>

I’m not sure what you mean by ‘self looping’ task. When a BT task finishes the control goes back to the tree (`BehaviorTreeComponent`, to be more precise) and the next task is found. To repeat, loop tasks you need to use dedicated decorators (like `BTDecorator_Loop`). I can see you don’t have anything like that so as soon as the “background” task finishes then that’s it, that branch is done and the parallel node waits for the main task to finish.

I hope it helps.

Cheers,

–mieszko

---

<div class="post-metadata">

**Author:** ![Dinomannen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dinomannen](https://forums.unrealengine.com/u/Dinomannen)\
**Post date:** [February 17, 2017, 2:39pm UTC](https://forums.unrealengine.com/t/behaviour-tree-cooldown-decorator-locks-out-task-indefinitly/385219/3 "2017-02-17T14:39:54Z")

</div>

I have played the background with and without a loop decorator, as long as the main task is in progress the background task plays, finishes and starts over both with and without the loop decorator. However if i add the Cooldown decorator it plays only once regardless of whether i have the loop decorator or not.  
The task i run in the background currently only contains printstring to show how many times it runs and a finish excecute.

Here are screenshots of my Task BP and of the different variations of Decorators on the Task with added screenshot of the output log for the respective situations.

 ![126738-backgroundtask.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/0/6/a060dec5d06cb03dcbb1a3de445e61b7f3369bed.png)

 ![126740-bht_bothdecorator.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/1/d/51dc073bf9f95152af18d19b88e9a749805b2a57.png)

 ![126741-bht_cooldowndecorator.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/a/f/4af21d2a25e81b0d2a3a58dd6286a1ed829eb51a.png)

 ![126742-bht_loopdecorator.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/5/9/d59997e73117b9f24677020622da7f1fd4d8b76b.png)

 ![126743-bht_nodecorator.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/c/c/9cc552ad6cbf0cb7e966b4524bcd773c6945a657.png)

---

<div class="post-metadata">

**Author:** ![Bizcochoman](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Bizcochoman](https://forums.unrealengine.com/u/Bizcochoman)\
**Post date:** [December 12, 2022, 4:13pm UTC](https://forums.unrealengine.com/t/behaviour-tree-cooldown-decorator-locks-out-task-indefinitly/385219/4 "2022-12-12T16:13:35Z")

</div>

Sorry for bumping the topic, but I am currently having this same issue. I have a very simple Behavior Tree setup, with just a Simple Parallel node with a MoveTo Task and an Attack Task. When adding a Cooldown decorator to the Attack Task, it just works once. Were you able to solve this problem?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/e/4/fe49faa424f6c939b677b2ab19fe64c5bff0e7ef.png)

---

<div class="post-metadata">

**Author:** ![Geovanny199911](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Geovanny199911](https://forums.unrealengine.com/u/Geovanny199911)\
**Post date:** [May 14, 2024, 2:23am UTC](https://forums.unrealengine.com/t/behaviour-tree-cooldown-decorator-locks-out-task-indefinitly/385219/5 "2024-05-14T02:23:31Z")

</div>

I also encountered this issue. I noticed, that if I have another task next to my task with the cooldown decorator, it works fine, it only behaves strangely, if it is the only task on that branch. However if it is the only one, you might use the wait task.
