Download

Changing Client Max Walk Speed does not work in Multiplayer

Hi, im pretty new to UE4 but spent many hours on my first Multiplayer Game. But now, i got stuck on a point. I was looking for several tutorials but could not solve my problem since now. Maybe one can help me on this issue. Thanks very much in advance

In my game, a player can throw something to another player and on hit, it will reduce the speed of walking. I can hit and reduce the “Speed” of another player and it works on the server but not on the client. i think it has to do with speed replication.
for testing purposes, i manually reduce the speed with the mouse wheel instead of throwing and hitting. My Blueprints are as following:



84c54af9eb0287988246152cf48e270acb0b7558.png

my Problem is, that the servers speed works perfect, but not the client. Thanks very much for helping in advance, any hint is very much appreciated
Regards
K.

You have to change the Speed on both Server and Client.
Create a RunOnServer Event and a RunOnClient Event which changes your speed.
The MaxWalkSpeed Variable is not replicated within the CharacterMovementComponent.

You should also get rid of the GetPlayerCharacter() node. Because it will behave differently on the Server aswell.
Use getControlledPawn(if you are working in a Controller) or self (if you are working directly in Character)

Hi, thanks very much for your fast reply. i somehow don’t get it. i got rid of the GetPlayerCharacter() node and set the “ChangeSpeed” to run on owning client and copied everything under “ChangeSpeed” and pasted it to “ServerChangeSpeed” which is set to “Run on Server”. But still, it does not work. Did i understand your hints correctly? or did i misunderstand it?
thanks for helping in advance
K

I did it similar to this:

In the DashPressed Event, I first change the local walking Speed and then I change it on the Server Version of my pawn.

2 Likes

Thanks very much for your fast reply. I rebuilt the whole speed movement and now it works

thanks a lot
K

Hi Max, can you post your setup???

Thx raildex it work perfectly