# With behavior tree, how to execute a task only once ?

**URL:** <https://forums.unrealengine.com/t/with-behavior-tree-how-to-execute-a-task-only-once/1379695>\
**Category:** AI\
**Tags:** Behavior-Tree, task, bttask, unreal-engine, Blueprint, question\
**Created:** [November 10, 2023, 11:06pm UTC](https://forums.unrealengine.com/t/with-behavior-tree-how-to-execute-a-task-only-once/1379695 "2023-11-10T23:06:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![imagineer](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/imagineer/32/562003_2.png) [@imagineer](https://forums.unrealengine.com/u/imagineer)\
**Post date:** [November 10, 2023, 11:06pm UTC](https://forums.unrealengine.com/t/with-behavior-tree-how-to-execute-a-task-only-once/1379695/1 "2023-11-10T23:06:04Z")

</div>

With Behavior tree, how to execute a task only once ?

---

<div class="post-metadata">

**Author:** ![Mind-Brain](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mind-brain/32/906573_2.png) [@Mind-Brain](https://forums.unrealengine.com/u/Mind-Brain)\
**Post date:** [November 11, 2023, 2:06am UTC](https://forums.unrealengine.com/t/with-behavior-tree-how-to-execute-a-task-only-once/1379695/2 "2023-11-11T02:06:12Z")

</div>

Hey @imagineer!

So you’ll do something like this:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/0/8/f08d1ee736d4eeba7a375c98c94be7d27e9ad265.png)

By setting your blackboard value to false, you prevent that branch from executing. 🙂

(Inside the change bool to true task:)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/7/e/77ebb33ed9f89e0835a54cc984ef54998c601f10.png)

---

<div class="post-metadata">

**Author:** ![imagineer](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/imagineer/32/562003_2.png) [@imagineer](https://forums.unrealengine.com/u/imagineer)\
**Post date:** [November 11, 2023, 8:49pm UTC](https://forums.unrealengine.com/t/with-behavior-tree-how-to-execute-a-task-only-once/1379695/3 "2023-11-11T20:49:51Z")

</div>

Thanks, very much !

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [December 11, 2023, 8:50pm UTC](https://forums.unrealengine.com/t/with-behavior-tree-how-to-execute-a-task-only-once/1379695/4 "2023-12-11T20:50:36Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
