(Multiplayer) I want the player to be able to change the colors of their character but the color variable won't replicate.
Like the title says, I want the player to be able to change their color using R, G and B sliders, the player sees that their color changed but can't see the other player's color change. I think it has something to do with how the game instance isn't meant for multiplayer replication(?) and if it isn't meant for it, could someone tell me what else I should use.
(I need the variables to keep their values when levels change, that is why I'm using a game instance)
Edit: The player sees their colors on other players.
The Game State:
Setting the Game state variables from the player options widget:
Setting The player's material:
(There is a Switch has authority and a set body color multicast connected to the "Then 1
Game Instance will preserve its variables when you join the server's level, but will not replicate, so I use Game Instance to keep track of the settings, then pass them from Client's playercontroller to do a Server RPC, then from the server's red RPC event node to Multicast (from the Game State!) to propagate those settings to all clients so they can see the color change in their version of the universe.
For some reason Server RPCs don't work if you do them from an actor that's not a playercontroller or part of the playercontroller's hierarchy, and multicasts don't work if you don't do them from a GameState or part of the GameState's hierarchy. Maybe other actors can do these things but I have mixed results. Those are the way to make sure it always works.
Game Instance is not replicated.
Game State is replicated and should be used for game related information such as this.
answered Nov 15 '18 at 04:22 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here