Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

I also hit the issue with the "super" jump, when jumping just before landing.


I think it's happening at the moment when the player is just above the ground -> ground check with raycasts says that the player is grounded, but the player's gravity scale is still upscaled for falling.


At that moment, the jump velocity is calculated based on "falling" gravity scale, but at the next frame the gravity scale is downscaled, because player is moving up now. This means that the players velocity is too high, for the new gravity scale, and the player will jump too high.


The fast and easy fix was to update gravityMultiplier and gravityScale at the top of the FixedUpdate, before DoJump() function is called, so it can operate on correct/newest values. Maybe there's a better solution, but this will work for now.


Idk if this is still relevant to you, just posting in case if anyone else stumbles across this issue. 

Oh my thank you for your explanation and fix!

I tried this and it didn't solve it. It only reduced the likelihood. I now understand why  the superjump happens though:

This dev log doesn't contain the full gravity multiplier check needed to handle jumping properly. Copying just what you see here will make your gravityMultiplier variable set itself to your jump cutoff. This is because it's missing a ground check. There's a lot more stuff missing for this gravityMultiplier. Go check out the calculateGravity function in the scripts you can download here.