Holding a hard reference to Spawned Actor doubles the mem?

If I Spawn an Actor and create a hard ref to it, am I storing it twice? I’ve started using the “Size Map” and can see any hard refs within a BP are the same size as the Actor.

Hope that makes sense! :slight_smile:

If you spawn an actor, you can make your reference of type actor, then you don’t have this problem.

But… a reference is just basically a pointer and consumes no space, unless you have the variable ( which has a certain type ), but never actually spawn that type. Then, you still use the same amount of memory anyway.

If you know you will use this type of object in a certain level, there’s no harm in having a hard reference. It won’t make any difference in that case.

So even if I set the type to “Actor” and have another ref in another BP to the same Actor it would not take up any more mem?

1 Like

Actor is a default engine type, so it basically uses no memory ( or very little ).

Of course, you can’t cast either, because that’s also a hard ref.

Then you need to use interfaces.

Thank u so much, will give this a try. I’m glad u know what I mean. :slight_smile:

1 Like