Hi all, I’ve been struggling with where to place some of my logic for my multiplayer game. I’ve been trying to set up a multiplayer trading card game and have been struggling to set up how players switch between turns. I’ve tried placing a changeable variable in the GameState but I’ve only found it to be editable from the server/player 1 and not from the client/player 2. Is there a way to go about changing GameState info from the client or is it read only? Follow up being where should such information such as player’s turn and editable info that should be shared between clients.
Im not sure at 100% but you dont need to use GameState for this. Theres also normally more than one ay to achieve most of the thing over there
In my point of View you should can do it all in the character controler BP. wich can contain any number of variable you need to control wich one the
players can act in his turn.
For example you can just disable the input of player 2 then player 1 should play his moves and viceversa.
also its usefull to post some screen of the part you think is problematic sometimes its easier to track an posible solution if we see what approach you took.
I agree with placing it in the character controller. I faced a similar issue when placing server code in the GameState. It would crash the editor when the game loaded a new level (menu → Level 1)
The reason that your player 2 (client) cannot change the game state is that he is not the owner of GameState. The server owns it. So you would need a ReplicateToServer event to say “I’m finished with my turn” and then the server does the change to your variable or state machine.