# Ai controller can never be destroyed or be garbaged collected

**URL:** <https://forums.unrealengine.com/t/ai-controller-can-never-be-destroyed-or-be-garbaged-collected/383732>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [February 2, 2017, 3:00pm UTC](https://forums.unrealengine.com/t/ai-controller-can-never-be-destroyed-or-be-garbaged-collected/383732 "2017-02-02T15:00:44Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![acatalept](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/acatalept/32/465177_2.png) [@acatalept](https://forums.unrealengine.com/u/acatalept)\
**Post date:** [November 30, 2022, 4:33am UTC](https://forums.unrealengine.com/t/ai-controller-can-never-be-destroyed-or-be-garbaged-collected/383732/16 "2022-11-30T04:33:35Z")

</div>

For anyone else still running into this problem… as noted above, the DestroyActor() node in blueprints has no effect, but there are other options that are just as simple – use either one of these:

- call the **SetLifeSpan()** node with a non-zero value (zero is equivalent to “indefinite” in this case), _ **OR** _

- set **AutoDestroyWhenFinished** to TRUE

 ![Unreal Engine - blueprint AI controller DestroyActor() node doesn't work](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/4/e/a4e96170b01a67c1c9ddd2885199b4873bb0d66f.png)

I use one of these nodes in my AI Controller blueprint’s OnUnPossess event, as well as SetActorTickEnabled(false) in the case of SetLifeSpan() in order to stop processing Tick events immediately.

Either of these methods appears to properly remove my AI Controller instance from the world outliner (and hopefully garbage collected etc).

Hope this helps!

---

_[View the full topic](https://forums.unrealengine.com/t/ai-controller-can-never-be-destroyed-or-be-garbaged-collected/383732)._
