How to make a double jump function for a 2D platformer

Hi

We are making a 2D platformer and would like to add a wall jump function to the game. What is the easiest way to do this with blueprints?

Thanks!

So you want to add wall jump or double jump function? :smiley:

I assume you meant wall jump, so here it is.

Wall jump is pretty simple, you have bool IsOnWall and and float WallNormal. On event hit on CapsuleComponent (Make sure simulation creates hit events is on), set the IsOnWall to true and WallNormal to Impact normals X axis. After that delay 0.1 seconds and after it, set IsOnWall to false.

When the jump function is called, add a branch that checks the IsOnWall. If not, jump regularly. If is, add impulse to character movement: Make vectorX:WallNormal Z:1 and after the make vector, multiply it by float WallJumpImpulse. The number must be really high sometimes, just play with it. I think that’s it, cheers! :slight_smile:

Sorry for the confusion, yes we ment wall jump.

Thanks for the quick response! :slight_smile:

No problem! :slight_smile:

Here you go :slight_smile:

(pssst I’m also trying to beat Luos at answerhub leaderboards, so I’m begging for some karma… :wink:

Would it be possible for you to make this as a blueprint and send a screen shot? That would be much appreciated. We can’t seem to get it to work, we are sort of new to Unreal.

Thanks again!

You are our hero! <3

Thanks a lot!

Right click on the impact normal and Split Structure Pin.

Hi again!

So we have a small problem. The Break Hit Result is there but we don’t have the Impact Normal X option, so there is no way to connect it with the Set Wall Normal. Are we doing something wrong?
93419-

Well that was easy. Thanks yet again! :slight_smile:

The Unreal Stick Figure 2D already has a double jump implemented.

Just open the Learn tab in the launcher and look for it.