RPC

Hi People, I’m creating a custom event in GameMode and setting it to run on the server and accessing this event from a widget when I press a button. The function seems to run on Listen server but doesn’t work on client side however if I move the event from GameMode to my Player pawn then it works in client mode too. Doesn’t game mode is replicated by default?
Why the event doesn’t work on client side if created in Game Mode but does work if created in Pawn?

Game mode only exists on the server

@Chitolocz Ain’t that Game mode base??? Doesn’t GameMode replicate to clients as well?

The Game Mode is not replicated to any remote clients that join in a multiplayer game; it exists only on the server, so local clients can see the stock Game Mode class (or Blueprint) that was used, but cannot access the actual instance and check its variables to see what has changed as the game progresses. If players do need updated information relating to the current Game Mode, that information is easily kept in sync by being stored on an AGameStateBase Actor, one of which will be created along with the Game Mode and then replicated out to all remote clients.

1 Like