Replicate function from Game State

I created two variables in my custom Game State (MyGameState) called MasterNumber and PlayerNumber, they are defaulted to -1.
I have a simple UMG blueprint with 2 buttons where a player can click. If a player clicks on the button that has “Master” as text initially, the OnClickEvent calls SetMaster in MyGameState that checks if MasterNumber is -1. If it is, it changes the value of MasterNumber to MyPlayerState->PlayerNumber (note that this is different from MyGameState->PlayerNumber).
Once this value changes, another function on the same UMG blueprint that is bound to the text that was initially “Master” should now return a different text. This function checks if MyGameState->MasterNumber is -1, if it is it returns “Master” if not, it returns MyPlayerState->PlayerName for the player with PlayerNumber == MyGameState->MasterNumber.

What happens is, I’m setting MyGameState->SetMaster to be replicated “On the Server”. However, it only changes MyGameState->MasterNumber value when I click it from the Server window, and the text on Master button changes on both windows. When I click it from the Client window, nothing happens.

How can I solve this issue?

I want to know too if it’s normal functionality or a bug.

Having the same issue here when using the Game State for a chat box, I have everything in every Blueprint set to replicate and literally gone overboard with setting to run on the server and authority only, but the client can only talk to himself when it all goes through the Game State and the server can talk to both and tried all sorts of combinations which all lead to the same result.

For anyone stumbling across this post…

Since the owner of the GameState actor is the server, any server function called through the GameState by a client machine will get dropped. See RPCs | Unreal Engine Documentation

By this logic you should never have any server functions in your GameState class.

If you want to send an RPC from a client machine to the server you must do this through a client owned actor, i.e. your APlayerController class

Thank you very much. I was running into this (trying to use the GameState as a mediator to let the server know that a client was ready to transfer to another level), but I couldn’t get more than 1 response (the server).