What is meant by "Outer Object"?

I am looking at the documentation for creating UObject instances here: Creating Objects in Unreal Engine | Unreal Engine 5.2 Documentation

It mentions that each method takes an optional “Outer Object” but I have no idea what that is or what it means.

Right now I am trying this, but while it compiles, it gives me an error: NewObject with empty name can’t be used to create default subobjects (inside of UObject derived class constructor) as it produces inconsistent object names. Use ObjectInitializer.CreateDefaultSuobject<> instead.


UHexTile* newTile = NewObject<UHexTile>(this);

Now I sort of understand what the error is saying, well not really but sort of, but despite the presumed typo in the suggested function, I don’t see how I could use it since I am not doing this in the ctor. Plus I don’t understand the “empty name” bit since the documentation specifically states using NewObject is designed to generate the name for you.

You should use ‘NewObject’ outside of the constructor.

In constructor, you would use:



UHexTile* newTile = CreateDefaultSubobject<UHexTile>(TEXT("HexTileName"));


This way, “Outer” (or owner) of newTile is the object that is currently constructed.

Hope this helps…

But this isn’t being called in the constructor. Err, well maybe it is from a long chain of things. I need to check I guess. But it can just as easily be called at any time.

If this is called outside of constructor, try this:



static int32 TileCounter = 0;
FString TileName = FString::Printf(TEXT("HexTile_%d"), TileCounter++);
UHexTile* NewTile = NewObject<UHexTile>(this, UHexTile::StaticClass(), *TileName);


This should give all tiles unique name…

Long story short, Outer object is something used in unreal code reflection, which looks more or less like this:

Outer.outer.Outer.MyObject.

1 Like

Construct Object From Class

What does outer object mean for this blueprint node?

It’s asking for outer object which specifies lifetime.

The “Outer” input will serve as the new object’s owner, which controls the lifetime of the created

I want to know what outer object is so I can figure out what the lifetime is.

After some testing, it seems Outer has to do with the garbage collection of the object as well. It seems like even if there are strong references to a UObject via TSharedPtr or UPROPERTY, if the Owner goes away, so do all the objects that were created with NewObject<…>(Owner).

I ran into this because I have a UMenuContext object stored on my UMyGameInstance class. The UMenuContext has a stack of UMenuWindow’s. These were getting deleted when I switched maps and the reason was that they were parented to the current AMenuPlayerController instead of the UGameInstance and so the garbage collector was deleting them when the player controller switched to a new one.

3 Likes