A Physics Based Character Controller for Unity — Part 2 Jumping

Single and double jump implemented

Creating the variables in the player script

private float _yVelocity;
private float _jumpHeight = 25.0f;
private bool _jumpAgain = false;

Implementing the single jump

if(_controller.isGrounded == true){
//do nothing for now
velocity.y -= _gravity;
_yVelocity -= _gravity

Implementing the double jump



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
Andrea Zilio

Andrea Zilio

Passionate Game Developer and Learning Expert. I love to create games and interactive experiences using Unity, Articulate, C#, JavaScript, PHP, HTML, CSS.