Day 86: How to add Double Jump to your Game

Objective: Allow the player to double jump!

In the last article we got the player moving around and jumping. Today is implementing the double jump! Today will be a quick one.

The first thing we need will be a bool that tells us if we can double jump.

Now in the section where we check for input from the player, we will set the bool to true.

The script is now letting us double jump, now we need to check to see if we can and then double jump. In our else section we will check for input again and than check to see if doubleJump is true.

If it is true, we will add on more jumpHeight to the cached yVelocity and true the bool back to false.

And that’s it! Our player can complete double jumps now! Thank you for reading and have a wonderful day!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Tyler Smallwood

Tyler Smallwood

46 Followers

I am passonate on learning to program and use Unity to become a skillful Unity Developer