At the start of the match I load body color and player name from the save file, then send them through player controller to controlled pawn.
Names always update correctly on all clients.
But the color seems to have some issues on client 2:
As you can see, it doesn’t change the color of cleints that connect after him.
I tried to update info on clients simultaniously, when all characters have spawned, but in this case, client 2 is not loading any color at all, even for himself. (but it works perfectly on all other clients)
Again, names are updating always correctly.
Client load > set profile > send to server.
Server registers.
(Server sends to client new player join or Client queries server that one player joined), client spawns in appropriate character(s) with server given peofile.
Not sure thats what you got from what I see up there.
The point is that someone has to be in an autoritative position to tell all clients what color is what - else client hacks are possible (like making the material transparent for instance).
If the save file was corrupt or empty - it wouldn’t change the color on other clients.
My logic of loading is:
Game mode loads array of “Player profile info” on itself. Then, when the new controller connects - it adds it to “Connected controllers” array. The game mode takes controller’s index and sends profile info with same index on that controller. Then controller sends it to controlled pawn and pawn(character) sets all nessesary parameters based on received info.
So I have to make the game mode to change the color of each character on each client, instead of making it in character BP?
Eventually this misterious bug was fixed in even more misterious way. I singed off “Replicates” on character class defaults.
My thoughts are that it replicated twice and caused this bug.
(And yes, it replicates perfectly fine with only “Replicate movement”)