NewObject constantly returns the same address?

Hello! I’ve been struggling with this for some time now and there doesn’t seem to be an explanation on the web…

Sooo, I’ve tried creating new objects in this way:

125055-capture.png

And what it does is this:

125056-capture1.png

What am I missing? I guess that the same name produces the instance being created on the same memory location. But how do I always generate new names? Is there a way to get like a random new name from a pool? Or do I link it to the instance name of the owner? Any advice will help. :slight_smile:

Hey there,

You are right, the issue here is that you use the same FName for the object name.
You can use the NAME_None instead, so then a unique name is being resolved by MakeUniqueObjectName().

Cheers!

2 Likes

I figured it out in the meantime but you’re right, that’s the correct way to do it.