Adding a Double Jump Feature to Your Game

Double jumping is a fun mechanic to add to your game. It gives extra maneuverability and can make moving around your game world more exciting. So how do you go about adding this feature? In my last article, I explained how to create a physics-based character controller. I will be adding the ability to double jump to this controller.


The first thing to do when implementing any feature is to think about how it will work. In the case of double jumping, you will want to check if the player is on the ground. If they are not you will want to check to make sure they have not already double jumped. If they are not on the ground and have not double jumped then you want to allow them to double jump.


The first step to creating the double jump feature is to create a boolean variable to check if the player has double jumped yet.

I am going to explain this in a little bit of a reverse way because it will make more sense this way.

After the player has jumped the first time you will check for the input to jump again. You will also be checking for the boolean variable that holds if the player has already double jumped. If the input is detected and the boolean variable is false meaning the player has not double jumped already you will allow the player to double jump.

To allow the double jump add the jump height variable to the current y value of the player. You will also set the boolean variable to equal true which will stop the player from jumping again.

When you have confirmed that the player has hit the ground you will want to set the boolean variable to false to allow the player to be able to double jump again.

You should now have a functional double jump feature.




Unity Game Developer and C# Programmer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

🎯Promote your NFTs : With Nft 🎯


4 Really Small Things That Say a Lot about You Hint: It’s not what you say.

How to Setup Conda Environments and Add Kernels for Jupyter Notebook?

Engineering career path at Alan

Unity Cross Platform Input

Jarvis+’s biweekly report! 2020.12.14–2020.12.27

Working Together: The Launch

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
Matthew Clark

Matthew Clark

Unity Game Developer and C# Programmer

More from Medium

Making A 2D Shooter — More Power

Adding a camera shake effect

Unity : Cinemachine and Timeline (Part VII)

“Game Feel”: The Impression Of Weight