How to check everything before start the game? (Multiplayer)

You have an authority check before the “wait for pawn ready” validation. So I guess this code is running on the server? If so, this doesn’t make any sense lol. There is no replication or any network delay on server side.

IMO each actor should be responsible for waiting necessary values / initial replication on their own. What I did for my plugin was create a basic “wait initial replication” system. It looks something like this:

  1. In your actor’s BeginPlay for example, call your custom WaitInitialReplication function.
  2. WaitInitialReplication function continuously calls IsInitialReplicationComplete via a timer.
  3. IsInitialReplicationComplete is an overridable function that returns either true or false. Actors can override this function to basically make a list validation checks for themselves. This is all happening locally!
  4. When IsInitialReplicationComplete returns true, I call a custom OnInitialized event.
  5. Now I can do any actor specific initalization in OnInitialized.
1 Like