What is the average time it takes to spawn a pawn? (multiplayer/online)

I have problems with the replication on my own computer because all the pawns are not spawned at the same time.

So I think that if this happens on my own computer through the network it will be much worse.

So I want to use a timer and replicate things after a certain amount of time to make sure everything replicates correctly.
Is it a good idea to do it like this? Or…?

The thing is, I don’t know how long it usually takes for a pawn to appear on the player’s computer.

Could someone tell me an approximate average time?

Or any way to know for sure that all the pawns have appeared on the players computers? (That could be another valid solution)

Thank you very much!!

You can’t approximate this. Don’t try to initialize the pawn in BeginPlay. Wait for all necessary properties to replicate and then do the initialization. You can use a timer to call a function repeatedly that checks whether all properties have replicated. Or you can use Rep_Notify.

1 Like

It highly depends on “why” you want to control spawn time… if you simply want to make sure they are all spawned at the same time (not like one after another after half a sec or so)… then just display a black widget covering the whole screen until all are spawned properly.

1 Like

I will try to do as you say.
Thank you very much for your help!!

At the moment it is only to change the skin of the pawn (the material). I have two teams, one blue and one red. I was spawning one by one. And changing their skin in that order. But some of the pawns do not perceive the change of skin of the others. I don’t know if it was because of the slowness or speed. So change the way to spawn the pawns. First I spawn them all and then change their skin.

Something like that:

However I have a delay in the middle… (just in case)

I hate delays. I know they are not a solution to any problem.

So I’m going to try the method that STRIFE.x recommends.

Thank you very much for your help!!

FYI that delay you have in the middle does absolutely nothing as you don’t have anything connected to its complete pin. It won’t stop the sequencer from doing its thing.

1 Like

Thanks… actually that’s good news.
That means restructuring the code fixed the replication problem…
I’m not comfortable with it anyway.
I will try your method.
thx u so much!! :sparkling_heart:

For the Skin issue Rep_notify worked more or less. I slightly changed the way to spawn the pawns and replicated the team variable.

It was something like this…


However, the attached Widgets and the HUD continue to give problems.

For now I have solved it like this.


Although I think I’ll use the timer if there is no other choice…

I really think this is all a bad business.
BeginPlay should simply not run until all components are ready…

Something so simple gives a lot of problems and confusion when programming.

I think I’m doing things wrong and actually the variables are not instantiated.

Thank you very much for your help!!
Very thankful!! :sparkling_heart: