Issue with Behavior Tree after AI Respawn

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?

Solved: Need to be place node Possess after Spawn Actor :sweat_smile: :grinning:

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!!