So I’ve been trying to get a double jump to work in blueprints for a little while now and can’t seem to get it to work. The logic checks out and when I go through debugging, it fires off correctly but it just doesn’t do a second jump.
Once the player hits the jump key, it checks to see if the player is currently jumping, if they aren’t, it will do an initial jump and say that it is jumping. If they were jumping, it then checks to see if they had already double jumped, if they have, nothing happens otherwise it will jump a second time, setting ‘HasJumped’ to true. Once the player lands, it resets both of those variables. They all fire like a charm but I only jump once and not twice.
I have also tried ‘AddMovementInput’ but to no avail as well. Any ideas and help would be greatly appreciated!
Hi Ben. The Jump function does not affect the character when they are mid-air. You can use the Launch Character function to achieve the same effect for the second jump.
Ah! Thanks so much Adric. I wasn’t sure if that would do the trick or not due to ‘launching’ sounding like it would be for something entirely separate. Thanks again!
Just to piggy-back off of this thread (sorry for reviving it), I’m trying to use the launch option in the side-scroller template, but nothing is happening. I’m trying to replicate the “bounce” from jumping on top of an enemy, and figured the double-jump was similar to what I was going for. Is there something I’m doing wrong? The script is pretty simple, it just calls launch on the player pawn when an event happens.
and what about the animations (sprites) can help to set animation for the second jump ? (i already have the sprites and know how to put inside “set flipbook” dont know where… )
Anybody coming back here, if you are using a character, you don’t have to create your own logic.
Simply check the Character Settings and increase Max Jumps to 2.
The reason the original Jump function did not work mid-air was because Max Jumps was just 1; however, you don’t even need that logic because the Character class does it by itself.
Hi, there is a simple way to make a double jump without any extra blueprint. Inside you player character’s blueprint there should be a variable parameter that says how many jumps you can do. You should be able to find this either in the movement component or the class default section.