# AI Controller gets destroyed

**URL:** <https://forums.unrealengine.com/t/ai-controller-gets-destroyed/481158>\
**Category:** AI\
**Tags:** controller, Destroy-Actor, unreal-engine, question\
**Created:** [March 31, 2021, 11:03am UTC](https://forums.unrealengine.com/t/ai-controller-gets-destroyed/481158 "2021-03-31T11:03:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![EvolveGamesDE](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EvolveGamesDE](https://forums.unrealengine.com/u/EvolveGamesDE)\
**Post date:** [March 31, 2021, 11:03am UTC](https://forums.unrealengine.com/t/ai-controller-gets-destroyed/481158/1 "2021-03-31T11:03:20Z")

</div>

Hello,

I have an AI Controller associated with an AICharacter (Character class). I spawn the AICharacter with the function “spawn ai from class”. If I destroy the AICharacter the AI Controller gets destroyed too. Why does it happen? Its very important that the AI Controller should persist.

Thanks for help:)

---

<div class="post-metadata">

**Author:** ![GrumbleBunny](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GrumbleBunny](https://forums.unrealengine.com/u/GrumbleBunny)\
**Post date:** [March 31, 2021, 1:08pm UTC](https://forums.unrealengine.com/t/ai-controller-gets-destroyed/481158/2 "2021-03-31T13:08:07Z")

</div>

Try disabling auto possess ai controller and spawn the controller + possess the pawn manually. That might prevent the controller from getting destroyed.

---

<div class="post-metadata">

**Author:** ![EvolveGamesDE](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EvolveGamesDE](https://forums.unrealengine.com/u/EvolveGamesDE)\
**Post date:** [March 31, 2021, 1:57pm UTC](https://forums.unrealengine.com/t/ai-controller-gets-destroyed/481158/3 "2021-03-31T13:57:25Z")

</div>

Thanks for helping me again. Seems to work with your tip:)

---

<div class="post-metadata">

**Author:** ![BamaGame](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BamaGame](https://forums.unrealengine.com/u/BamaGame)\
**Post date:** [April 1, 2021, 1:50am UTC](https://forums.unrealengine.com/t/ai-controller-gets-destroyed/481158/4 "2021-04-01T01:50:26Z")

</div>

before destroying just un possess your Controller and make a reference for it now you can assign your ai to a new character.

![334276-destroyai.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/9/a/b9a556ed4fe08d996fd9ddba99991f0ac28ca7ed.jpeg)

---

<div class="post-metadata">

**Author:** ![adambernath](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/adambernath/32/88714_2.png) [@adambernath](https://forums.unrealengine.com/u/adambernath)\
**Post date:** [July 21, 2021, 6:37pm UTC](https://forums.unrealengine.com/t/ai-controller-gets-destroyed/481158/5 "2021-07-21T18:37:48Z")

</div>

or just possess the new pawn before destroying the previous one, that’s probably the easiest - that way the controller wont get destroyed
