Physics Based Character Controller Part 2

Simon Leen
1 min readAug 18, 2021

--

Objective: Add Double Jump to your Game

In the previous post we started setting up the Player Controller. Now we want to allow the Player to double jump. We start by create a private bool for the double jump and set it to false by default.

Next we only want the double jump to be active after the Player has jumped once. For this we start by going into the jump on space while the Player is grounded and when the jumps we set the can jump to true. Next inside the else meaning when the Player is not on the platform, we run another conditional if to check if the space key has been pressed again and if double jump is true and if so modify the Y velocity adding the jump float value to it.

In the next post we will look at the collectables.

--

--

No responses yet