What's the practice for spawning replicated Actors with parameter variables?

Hey there,
I recently encountered a similar issue when attempting to create a reconnect feature in my game. While I solved my issue in a different way, perhaps this can help you as a workaround:
Every AActor has two functions ‘OnSerializeNewActor’ (Server) and ‘OnActorChannelOpen’ (Client) that you can override and send custom data with. As a reference, you can take a look at the implementation in APlayerController. Unreal does not provide any syntactic sugar with this, so if you wanted to leverage this feature, you would have to implement it manually, I’m afraid. Still, I think this is one possibility to send such ‘spawn parameters’. I am unable to test it out myself right now but judging from the code this serialization step is executed after BeginPlay on clients.

1 Like