Double Jump does not work on client

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:

  1. Create an event dispatcher in your character blueprint and name it DoubleJumpAction.
  2. Set the DoubleJumpAction event’s replication to run on server.
  3. Create an input parameter for the DoubleJumpAction event, and make sure the type of the parameter is a reference to the class of your character blueprint.
  4. Create an event dispatcher in your character blueprint and name it BroadcastDoubleJump.
  5. Set the BroadcastDoubleJump event’s replication to multicast.
  6. Create an input parameter for the BroadcastDoubleJump event, and make sure the type of the parameter is a reference to the class of your character blueprint.
  7. Instead of directly handling the double jump action in the character blueprint at the jump event, call the DoubleJumpAction event.
  8. Route the DoubleJumpAction event to the BroadcastDoubleJump event.
  9. From the BroadcastDoubleJump event link to the function that will perform the double jump.

131007-eventdispatchers.png

131008-inputaction-jump.png

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.