Delay jumping on the ledge


I don’t really know to ask this question. I am trying to make the player being able to jump once the character is over an ledge. This is something very common in platforms games, where you usually jump once your character is on the ledge or even when it pass through it.

In this “awesome” drawing I made, the red box represents the default UE jump and the green one the one I’m trying to achieve.

If I offset the relative location of the mesh, I get the desired result, but I also get another problems like the mesh going through surfaces and “snappy” rotations.

Maybe I should put the character into flying mode and fake gravity with a lot of ray-tracing, but I’d like to hear others people opinions before I jump into that :slight_smile:

Thanks for you help!

Ok, I went with the launching way and raytracing to check if there is ground bellow of before the character. I post here my solution in case somebody needs it or wants to discuss about if there is another better way :slight_smile:

Mate you made my day : ). I was stuck about 1 week with this jump.
Thanks a lot for this, and i wish you weel ; )

There is much cheaper and simple way to achieve this. Set the Character’s default “Jump Max Count” variable to “3”. Then on your Jump’s InputAction Event do a branch check if Z Velocity is <= -400. If true, set “Jump Max Count” to “2”. Then OnLanded Event reset “Jump Max Count” to “3”.

This allows the character to do a double jump after they slightly went over the edge, but still retains the Fall = Jump if the falling over the edge is faster than -400 velocity.

I found the easiest way was to enable double jumping on your character BP. (Jump max count = 2). This also enables double jumping.

Alternatively if you don’t want to add a double jump at all times, you can use the “event on movementmodechanged” to track when your character first moves into a falling state → then for a temporary period of time you can udpate the double jumping to 2. After the time period ends you can return it back to 1 again. Hope that helps the next person :wink: