Download

Does GameMode only run on server?

Can someone help confirm this? Somehow I couldn’t retrieve any gameMode from any of the connected clients. Function GetAuthGameMode() also only work on a server too, so I’m suspecting that GameMode only exist on the server. Is this right?

Best,

Yes, GameMode exists only on server. You should use GameState to replicate game dependent variables to clients.

Cheers,
Marcin

Can gamestate be extended with custom network functions? If not, where do I best put client-to-server game logic function?

Ps. I’m about to put this in playercontroller class but it doesn’t seem like a good place for game logic…

Player controller is a place for handling inputs and sending those informations to the server (each client has one instance, server has replicated copies).

You should check C++ implementation of ShooterGame and read about RPCs.
The best choice for implementing game logic is the GameMode, and for the state: GameState and PlayerState.

Cheers!

Arr yes I got it… Use Playerstate to send client rpc to server and use gamestate to send server rpc back. Thx. :slight_smile: