Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(1 edit) (+2)

Small note for those that opt to rewrite this code manually instead of downloading the files:

The movement script needs to copy the rigidbody velocity or it will set the Y velocity to 0. Just add:
velocity = body.velocity;

Place it under the onGround check in FixedUpdate. As far as I know this makes it all work as intended. Lastly:

The variables you can input in the game itself aren't accurate reflections of their Unity Editor values. Check the downloaded scripts to see what the in game options are for these values.


Update: I believe I have found and solved the problem giving the player a super jump. If you're rewriting the code yourself here's what's missing:

When you (are on) land, your gravity multiplier is supposed to be 1. There's an if statement in FixedUpdate asking if we're going up (body.velocity.Y > 0.01f). This if statement is incomplete. In fact, it's part of a larger check. Long story short, your gravity multiplier is being set to your jump cutoff variable which causes the following jump to overcompensate. I suggest looking in the scripts added to this page. Inside the jump script you'll find a calculateGravity function. All the checks you need are in there.