Making a Double Jump

Now that we have a basic player movement, it’s time for making a double jump.

Create a bool variable called _doubleJump.

We want to use double jump when we are not grounded. After jumping we will set _doubleJump to true to allow a double jump.

We need to check if the player hit the space key again when falling (isGrounded = false) and if double jump is set to true. Next we double jump and set _doubleJump to false.

--

--

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