How do I manually delete uobjectd objects created by Construct Object from Class?

52600DED-9D07-44fc-AE96-3874E1C738B6

2 Likes

The easiest way to delete objects is to simply set all references to the object to “None” (null.)
The Unreal garbage collector will take care of the rest.
If you positively need to “destroy” the object right now, AND you know there are no other references to it, you can call ConditionalBeginDestroy(), but it’s really neither necessary nor usually a good idea.

Edit: If your object is an AActor there is also AActor::Destroy() to start the shut-down of the object, and send its destruction on the network if it’s replicating.

2 Likes

Can the set by-ref var blueprint node set a uobject to null? The destructor of the uobject does not respond.

UObjects are not destroyed when they are first set to null; they go in a queue, which gets gabage collected after there are no references to the object.

If you need to do something explicitly at a given time, you need a method on the object to do that, and need to call that method. UWorld::DestroyActor() is an example of one such function, specifically for AActor objects.

1 Like