# Destroy Object

**URL:** <https://forums.unrealengine.com/t/destroy-object/136337>\
**Category:** Blueprint\
**Tags:** unreal-engine\
**Created:** [January 12, 2020, 7:58am UTC](https://forums.unrealengine.com/t/destroy-object/136337 "2020-01-12T07:58:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sergiy\_Plamen](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sergiy\_Plamen](https://forums.unrealengine.com/u/Sergiy_Plamen)\
**Post date:** [January 12, 2020, 7:58am UTC](https://forums.unrealengine.com/t/destroy-object/136337/1 "2020-01-12T07:58:00Z")

</div>

Maybe a silly question, but is there a function in blueprints which destroys objects? Like destroy actor, or destroy component? I’m currently trying to use a custom object class instead of actor components (I have my reasons), I create objects via “Construct object from class” but can’t find a way to destroy them.

---

<div class="post-metadata">

**Author:** ![Synia](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/synia/32/88715_2.png) [@Synia](https://forums.unrealengine.com/u/Synia)\
**Post date:** [January 12, 2020, 9:23am UTC](https://forums.unrealengine.com/t/destroy-object/136337/2 "2020-01-12T09:23:55Z")

</div>

You should take a look at the principle of garbage collection: [A new, community-hosted Unreal Engine Wiki - Announcements and Releases - Unreal Engine Forums](https://wiki.unrealengine.com/Garbage_Collection_Overview)  
Briefly summarized, in order to delete a UObject from the memory you have to remove all references to this object, then it will be deleted in the next garbage collection cycle.

---

<div class="post-metadata">

**Author:** ![BIGTIMEMASTER](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bigtimemaster/32/710746_2.png) [@BIGTIMEMASTER](https://forums.unrealengine.com/u/BIGTIMEMASTER)\
**Post date:** [May 11, 2022, 9:10pm UTC](https://forums.unrealengine.com/t/destroy-object/136337/3 "2022-05-11T21:10:17Z")

</div>

Sorry to bump old thread, but the link is no longer working. I’m not sure if it is better ot make a new thread or not.

If I understand correctly, setting an object variable to nothing would nullify it:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/a/6/3a6ba303a208179eb4dcc11c674e1175c18a2347.png)  
and then unreal will automatically handle the garbage collection as needed.

And further from that, as you can see I am overwriting the variable with a new class sometimes, in which case the result should be the same?

In other words, operating this way shouldn’t be an issue, even if we are creating these objects often (like having it tied to input bindings, i.e. whenever widgets are opened/closed a new “state object” is created)?

---

<div class="post-metadata">

**Author:** ![rebusb](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rebusb](https://forums.unrealengine.com/u/rebusb)\
**Post date:** [May 11, 2022, 11:37pm UTC](https://forums.unrealengine.com/t/destroy-object/136337/4 "2022-05-11T23:37:48Z")

</div>

There is the Destroy() method on AActor class (so anything that inherits from it).

This destroys the actor it is called on. It is asynchronous meaning it may not do it immediately. It does it by the/at the end of the tick.

Check out the docs on the method [here](https://docs.unrealengine.com/4.27/en-US/API/Runtime/Engine/GameFramework/AActor/Destroy/).

---

<div class="post-metadata">

**Author:** ![BIGTIMEMASTER](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bigtimemaster/32/710746_2.png) [@BIGTIMEMASTER](https://forums.unrealengine.com/u/BIGTIMEMASTER)\
**Post date:** [May 12, 2022, 12:13am UTC](https://forums.unrealengine.com/t/destroy-object/136337/5 "2022-05-12T00:13:14Z")

</div>

Thats only for an Actor though. We are talking about an Object (another layer above Actor):

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/e/3/ce3b976d68c92db3324b690705582cb6d6827705.png)

As far as I can tell, from blueprint there is no way to destroy it?

edit:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/9/f/b9f1a70c1776f511c73469800bdfdbab49d9d2a5.png)  
It looks like this is the method to do it ^, but I wonder if there is a way to call such method from in blueprints? Or perhaps its not necessary though.

---

<div class="post-metadata">

**Author:** ![letthemicefree](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/letthemicefree/32/989563_2.png) [@letthemicefree](https://forums.unrealengine.com/u/letthemicefree)\
**Post date:** [November 7, 2026, 5:25pm UTC](https://forums.unrealengine.com/t/destroy-object/136337/6 "2026-11-07T17:25:37Z")

</div>

They get automatically freed when they have no more reference. There is no way to manually destroy them in blueprint by default.
