# Issue with Behavior Tree after AI Respawn

**URL:** <https://forums.unrealengine.com/t/issue-with-behavior-tree-after-ai-respawn/2165417>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [December 2, 2024, 9:03pm UTC](https://forums.unrealengine.com/t/issue-with-behavior-tree-after-ai-respawn/2165417 "2024-12-02T21:03:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jorgy\_M](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jorgy_m/32/88713_2.png) [@Jorgy\_M](https://forums.unrealengine.com/u/Jorgy_M)\
**Post date:** [December 2, 2024, 9:03pm UTC](https://forums.unrealengine.com/t/issue-with-behavior-tree-after-ai-respawn/2165417/1 "2024-12-02T21:03:05Z")

</div>

And Hello again)))

I’m encountering an issue with my Behavior Tree in Unreal Engine 5. Here’s the situation:

1. **AI Respawn Setup** :

- The AI character is destroyed and respawned multiple times during gameplay.
- Upon respawn, the Behavior Tree is restarted for the new AI instance.

1. **Problem** :

- After the second respawn, the Behavior Tree seems to “freeze” or get stuck on a particular task (e.g., **Wait** or **Move To** ).
- While the AI character is still moving and interacting correctly in the game world (e.g., walking between points), the Behavior Tree debug view shows it’s stuck on a task that shouldn’t be running.

1. **Details** :

- I use the `Stop Logic` node before destroying the AI character to stop the Behavior Tree.
- On respawn, I restart the Behavior Tree with the `Run Behavior Tree`.
- Tasks like `Move To` and `Wait` sometimes don’t complete properly, and this seems to cause the tree to become unresponsive.

1. **Debugging Steps Tried** :

- Clearing the `Blackboard` values before restarting the Behavior Tree.
- Using `Stop Logic` to halt the tree before destroying the AI.
- Ensuring the AI Controller and components are fully initialized before restarting the tree.
- Logging the status of tasks and `Blackboard` values, but no clear reason for the issue is apparent.

1. **Additional Observations** :

- The problem doesn’t occur after the first respawn but consistently happens on subsequent respawns.
- It seems related to tasks not properly aborting or finishing, especially `Move To`.

Question:

What could cause a Behavior Tree to freeze or show incorrect task statuses after multiple respawns? How can I ensure that tasks like `Move To` and `Wait` correctly reset or abort when stopping and restarting the tree?

---

<div class="post-metadata">

**Author:** ![Jorgy\_M](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jorgy_m/32/88713_2.png) [@Jorgy\_M](https://forums.unrealengine.com/u/Jorgy_M)\
**Post date:** [December 3, 2024, 9:28am UTC](https://forums.unrealengine.com/t/issue-with-behavior-tree-after-ai-respawn/2165417/2 "2024-12-03T09:28:27Z")

</div>

Solved: Need to be place node Possess after Spawn Actor 😅 😀

---

<div class="post-metadata">

**Author:** ![Maximum.Dino](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Maximum.Dino](https://forums.unrealengine.com/u/Maximum.Dino)\
**Post date:** [April 3, 2025, 11:17am UTC](https://forums.unrealengine.com/t/issue-with-behavior-tree-after-ai-respawn/2165417/3 "2025-04-03T11:17:32Z")

</div>

Hello, may I ask the details of your solution? I’m having a hard time figuring out how to use the possess node, and what to plug in to the “target” and “In Pawn” in the possess mode. My game is almost exactly like yours when it comes to the original problem, I’m respawning an AI character and the behavior trees are no longer responsive.  
Thank you!!
