I am creating a multiplayer game, where a player can toggle walk/run by clicking on a button in the UI. In a single player game this works fine, but in a multilayer game, the button only works for the server. I assumed this must be related to server/client replication, so I added a custom event to replicate the max walk speed to the server but still it does not work. Am I missing something? Perhaps it related to play index but I cannot work it out.
Toggle max movement speed using UI click on a multiplayer game
I will answer my own question. In order for this to work, the server must be told that a player has toggled walk/run. On a click on the UI, I created a custom event which runs the toggle run function to the server.
After a click on the UI, this information is cast to the character blueprint, and runs a custom event.
This custom event is run on the server in the player character blueprint, and updates the movement of the player.