# Attack Cooldown

**URL:** <https://forums.unrealengine.com/t/attack-cooldown/428068>\
**Category:** AI\
**Tags:** Behavior-Tree, range, attack, unreal-engine, question\
**Created:** [June 25, 2018, 6:17am UTC](https://forums.unrealengine.com/t/attack-cooldown/428068 "2018-06-25T06:17:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_249a29ad](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_249a29ad](https://forums.unrealengine.com/u/anonymous_user_249a29ad)\
**Post date:** [June 25, 2018, 6:17am UTC](https://forums.unrealengine.com/t/attack-cooldown/428068/1 "2018-06-25T06:17:41Z")

</div>

Hello everyone, I have been stumped on this problem despite working on it for hours this week. I am aware that UE4 allows us to use a cooldown decorator node in the behavior tree. However, the problem with the cooldown decorator is that it locks up the entire behavior tree for its duration. I am trying to create an enemy that stays within a certain range of the player by either retreating or advancing, while at the same time, throwing a bomb every two seconds. If I use a cooldown node on my attack task, what happens is that the enemy cannot move around during the cooldown. I want to make sure that the enemy can only attack every two seconds, but at the same time move around even if the attack task is still cooling down. Can anyone help me?

 ![245313-cooldown-capture.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/d/0/ed0f843373620582cb05777e59cb08c6e34beea4.jpeg)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_249a29ad](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_249a29ad](https://forums.unrealengine.com/u/anonymous_user_249a29ad)\
**Post date:** [June 28, 2018, 9:19pm UTC](https://forums.unrealengine.com/t/attack-cooldown/428068/2 "2018-06-28T21:19:16Z")

</div>

I found a solution. I decided to replace the attack task with an attack service that goes off every 2 seconds.
