# Pausing and resuming Behavior Tree

**URL:** <https://forums.unrealengine.com/t/pausing-and-resuming-behavior-tree/1249446>\
**Category:** AI\
**Tags:** Behavior-Tree, ai-controller, unreal-engine, question\
**Created:** [August 3, 2023, 12:57pm UTC](https://forums.unrealengine.com/t/pausing-and-resuming-behavior-tree/1249446 "2023-08-03T12:57:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![m5m](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@m5m](https://forums.unrealengine.com/u/m5m)\
**Post date:** [August 3, 2023, 12:57pm UTC](https://forums.unrealengine.com/t/pausing-and-resuming-behavior-tree/1249446/1 "2023-08-03T12:57:03Z")

</div>

Hi there!

**TL;DR:** Is there any way to completely **pause** a behavior tree’s execution and later **resume** it at the exact **same** spot / node where it was?

**Long explanation:**  
I’ve built my NPC’s AI through behavior trees. They move, animate and perform different tasks. I need them to **pause** when the player opens certain menus, and then **resume** the execution at the exact same spot, as if nothing had happened, when the menu closes.

**I can’t just pause the whole game** because I’m using timers to drag and drop widgets, and spawning actors while these menus are open. I’ve tried setting **Tick Even when Paused** to true in the actor that creates the widgets, to no use.

I have also tried setting the **Custom Time Dilation** to 0 for the NPCs and they do pause, but if the behavior tree is running a Move To node, it fails after a few seconds and the sequence or the branch restarts.

Any suggestions on how to solve this? Am I approaching it the wrong way? I’m using blueprints, but I’m open to a C++ solution at this point 🥲

Thank you!!
