[Multiplayer] I Can't replicate the variable from the client

I have 3 players and one blue box, if one user click on the blue box they should turn red to all of them

  • When the server click on the box the
    box turn red for all everyone
    (it’s Correct)
  • When the users click on the box, only
    his box will change the color :frowning:

I want to change the GameState variable from the client and replicate it to everyone (What should i do?)

A client can only call server RPCs on actors that client is the “Net Owner” of. This usually means Player Controller and Pawn/Character.

Add a Server Event to your player controller that calls your Gamestate event.

Also, it looks like you’ve got the events the wrong way round in Gamestate ce_ChangeSelection. Your calling the server RPC on the server (Authority) and the multicast if remote (this will have no affect)

Almost there. You need to make onclicked_event_0 call a server RPC inside Player Controller. Then make that server RPC call the method on Gamestate. Does that make sense?

Basically in multiplayer the only thing a client can do is call server RPCs defined inside their own player controller / pawn.

Well if i understood you correctly i can’t call a server event from the box object right?

So i moved all the code from the box to the playercontroller but the results are the same unfortunately

OMG IT’S WORKING

Thank you so much man, god bless you for your kindness

For some reason my solution doens’t work for 2 players, only 3

the server doens’t change his color

Now its work for 2 and 3 players, this is the final result guys…thanks