Local spawn

Hey all,

If an actor is spawned from a client, it will not be replicated to other clients automatically if I understand correctly. Thus this should be done by sending a RPC to the server so it spawns the actor and replication occurs.

My question: what if I want the actor to always spawn locally only, even when the current client is also the server? I want to do this because some actors should be private to the current player.

Also of note, the ‘Replicates’ flag is set to true for the actor, since most of the time the spawn should be replicated. I’m looking for a way to override that flag at spawn time in discrete situations.

Hi joelr,

Yes, your understanding is correct, actors spawned on a client will not be replicated to the server or other clients.

I don’t believe it’s possible to pass the replicates flag as a parameter of spawning an actor, but you can call the SetReplicates function on an actor after it’s spawned. You might be able to achieve the result you want by setting “Replicates” to false in the defaults, and for the cases where you do want the actor to replicate, call “SetReplicates” on it after it’s spawned.

1 Like