GameState not replicete in time on client


Did anyone had this problem or bug?

I work on lobby menu. In my **GameMode ** in event OnPostLogin i add new connected player to array **AllPlayers ** - in this array all player controllers

After that in my player controller i start function PCSetupLobbyMenu which is create lobby menu(widget) on connerted client. Function type - Run on owning client

After that i use function GMUpdatePlayersListInLobby (run on server), this function are in GameMode.

Function GMUpdatePlayersListInLobby

In this function every player controller run function PCUpdatePlayerLists (Run on owning client).

In this function i get GameState and for each element in GameState->playerArray i create widget add it as child in my PlayerList Widget.

All works, but works only with delays

I use delay in PlayerController->EventBeginPlay 0.1 second and in PlayerController->PCUpdatePlayerLists - 0.3 seconds

It doesn’t work without delays because when PlayerController->EventBeginPlay GameState doesn’t exist on client.

Am i right or problem in something else?
How to fix that and work without delays?
Anyone know in what oder UE4 create classes and start game?

can anyone correct error in replicate in title? replicate == replicate

its not bug very probably. im using many delays in my multiplayer game… probably its do-able without delays but you must exactly know game “flow” and make consecutive calls i think…

i think i found solution.

i found post where is said that this is the order in which ue4 create classes.

Player Controller -> HUD -> Game Mode -> Game State -> Player State ->Level

So i just relocate my functions to playerState and it works without delays

I had the same issue and am also now using player state. Using ticks in playerstate I check each tick to see if my custom players state is ready on the client. Once it is I disable ticks and notify the player controller of the client that it has a playerstate ready to process. On the server the player states are ready in 0 ticks. On the client it looks like it takes around 2 ticks for the playerstate to be fully replicated on the client side.