[MP] SpawnActor : sending the returned variable to the client will be empty

Hello,

I’ve been struggling with that for a long time, and kind of worked around it, but now I really want to clean the mess I had to do to circumvent that problem.

The issue is when the server Spawn an actor and send the returned variable to the client, it seems like when the actor receive the Variable reference, the actor has not finished spawning and thus the variable is empty.

This is my setup. The GameMode is spawning a new actor and send a custom event containing the variable.

114421-spawnactor_emptyvariable_0.jpg

And this is the pawn receiving the variable

The Check is always NotValid…

If I add a delay before sending the variable, it works fine though. But in my game i’m using a loop to spawn several elements and they take a bit of time for the client to receive. So a delay is NOT reliable, it’s dirty and unsafe.

What’s the trick to make sure the client properly receive the variable reference?

Thanks !

Hello,

I have yet to find an elegant solution for this, and always ALWAYS end up struggling with this when I need to spawn a new actor and send the variable to the client.

Has anyone having any idea on how to solve this?

Thanks

Eventually someone will answer this :slight_smile:

Any UE staff member ?