# How do I unassign an AI Controller to a Pawn?

**URL:** <https://forums.unrealengine.com/t/how-do-i-unassign-an-ai-controller-to-a-pawn/300470>\
**Category:** AI\
**Tags:** Behavior-Tree, unreal-engine, Blueprint, question\
**Created:** [December 3, 2014, 2:45pm UTC](https://forums.unrealengine.com/t/how-do-i-unassign-an-ai-controller-to-a-pawn/300470 "2014-12-03T14:45:44Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Loxli](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Loxli](https://forums.unrealengine.com/u/Loxli)\
**Post date:** [December 3, 2014, 2:45pm UTC](https://forums.unrealengine.com/t/how-do-i-unassign-an-ai-controller-to-a-pawn/300470/1 "2014-12-03T14:45:44Z")

</div>

Hi all,

I’m trying to kill an enemy and make it a ragdoll. How can I remove the Ai controller and stop any behavior?  
I’m using a behavior tree.

---

<div class="post-metadata">

**Author:** ![Pierdek](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pierdek](https://forums.unrealengine.com/u/Pierdek)\
**Post date:** [December 3, 2014, 2:59pm UTC](https://forums.unrealengine.com/t/how-do-i-unassign-an-ai-controller-to-a-pawn/300470/2 "2014-12-03T14:59:32Z")

</div>

Call UnPossess() on Pawn-\>Controller.

---

<div class="post-metadata">

**Author:** ![Loxli](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Loxli](https://forums.unrealengine.com/u/Loxli)\
**Post date:** [December 3, 2014, 3:24pm UTC](https://forums.unrealengine.com/t/how-do-i-unassign-an-ai-controller-to-a-pawn/300470/3 "2014-12-03T15:24:39Z")

</div>

Hmm I did it, but the behavior tree and some other AI functions are still running. I would like to make my AI dead

---

<div class="post-metadata">

**Author:** ![Pierdek](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pierdek](https://forums.unrealengine.com/u/Pierdek)\
**Post date:** [December 3, 2014, 3:35pm UTC](https://forums.unrealengine.com/t/how-do-i-unassign-an-ai-controller-to-a-pawn/300470/4 "2014-12-03T15:35:11Z")

</div>

On UBehaviorTreeComponent\* call StopTree()

---

<div class="post-metadata">

**Author:** ![Loxli](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Loxli](https://forums.unrealengine.com/u/Loxli)\
**Post date:** [December 3, 2014, 3:41pm UTC](https://forums.unrealengine.com/t/how-do-i-unassign-an-ai-controller-to-a-pawn/300470/5 "2014-12-03T15:41:14Z")

</div>

well, I’m using blueprint and Stop Tree doesn’t exist ☹

---

<div class="post-metadata">

**Author:** ![Pierdek](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Pierdek](https://forums.unrealengine.com/u/Pierdek)\
**Post date:** [December 3, 2014, 3:51pm UTC](https://forums.unrealengine.com/t/how-do-i-unassign-an-ai-controller-to-a-pawn/300470/6 "2014-12-03T15:51:11Z")

</div>

Ouch ;0.

---

<div class="post-metadata">

**Author:** ![Erumaru](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Erumaru](https://forums.unrealengine.com/u/Erumaru)\
**Post date:** [February 3, 2017, 4:51am UTC](https://forums.unrealengine.com/t/how-do-i-unassign-an-ai-controller-to-a-pawn/300470/7 "2017-02-03T04:51:40Z")

</div>

May be I help someone, get BrainComponent from Ai Controller then use StopLogic()

---

<div class="post-metadata">

**Author:** ![Lord\_Hypersonic](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lord\_Hypersonic](https://forums.unrealengine.com/u/Lord_Hypersonic)\
**Post date:** [March 30, 2019, 9:39pm UTC](https://forums.unrealengine.com/t/how-do-i-unassign-an-ai-controller-to-a-pawn/300470/8 "2019-03-30T21:39:33Z")

</div>

Hey! You can use the function: Detach From Controller Pending Destroy  
This will detach the controller from the AI. You can refer to the picture given below:-

 ![272822-detach-from-player-controller-destory.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/e/9/2e97e7f9d4ce1a95418c86deb807eba85b9f9955.png)

---

<div class="post-metadata">

**Author:** ![egerge1y](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@egerge1y](https://forums.unrealengine.com/u/egerge1y)\
**Post date:** [June 17, 2023, 12:13pm UTC](https://forums.unrealengine.com/t/how-do-i-unassign-an-ai-controller-to-a-pawn/300470/9 "2023-06-17T12:13:18Z")

</div>

“Detach From Controller Pending Destroy” Node working perfectly to me also. Destroy all (spawned)AIControllers (eg.: 100), then i can spawn another 1.
