Download

APlayerState replication

So I was looking at the player state code in shooter game, and noticed that AShooterPlayerState is correctly created on the clients, but AShooterPlayerState::OnRep_TeamColor never gets called.

It looks like the player state is not being replicated across the network, I am having the same issue in my own game as I have copied the same architecture as shooter game for the player state but cant seem to get the class to replicate to all clients which it is meant to according to the documentation:

Is the OnRep_TeamColor only for specific game modes? Are you sure the state is associated with the correct game mode?

I’ll take a look at this stuff actually, because its relevant to me too.

It looks like its always meant to be replicated regardless of gamemode:

DOREPLIFETIME( AShooterPlayerState, TeamNumber );