So I use this BP to manage the double jump.
It works perfectly on the server but when I try to make a doublejump as client it kinda “bugs” and in the server it looks like it was a normal (1 time) jump.
So I use this BP to manage the double jump.
It works perfectly on the server but when I try to make a doublejump as client it kinda “bugs” and in the server it looks like it was a normal (1 time) jump.
I know this question was asked a very good while ago, but I’ve stumbled upon this issue myself and also came up with a solution to this problem, so I thought I should share my findings for anyone else that has this same problem.
The issue here is that when you run the game with a dedicated server, the double jump action has not been transmitted to the server, and therefore is also not being broadcast to any client. The way to fix this is to set up some event dispatchers that replicate the action.
Here are the steps that I took:
DoubleJumpAction
.DoubleJumpAction
event’s replication to run on server
.DoubleJumpAction
event, and make sure the type of the parameter is a reference to the class of your character blueprint.BroadcastDoubleJump
.BroadcastDoubleJump
event’s replication to multicast
.BroadcastDoubleJump
event, and make sure the type of the parameter is a reference to the class of your character blueprint.DoubleJumpAction
event.DoubleJumpAction
event to the BroadcastDoubleJump
event.BroadcastDoubleJump
event link to the function that will perform the double jump.Instead of tying the upwards “Launch Velocity” node to a particular calculated vector, you could just set the Z value to whatever height in UE’s units (i.e 750) you are wanting the player to launch up. The Launch Character node is networked by default, and by setting the Z value to something positive, the player is going to move upwards regardless of client-server relations.
I would advise doing the same thing as the answer by “bcnobel”, binding the input to fire off a Reliable Event on the Server, which then calls a function in which you could have all of this in the function.