Framework 1: Idle Jump

Adding the idle jump animation

Since we have the regular running jump, it is only practical to add in the idle jump. This idle jump animation is going to be different from the running jump.

Preparing the Idle Jump:

First download a idle jump animation from the Mixamo website. Import and set up the animation similar to how we did the running, idle and running jump then add the animation clip to the Animator.

This is the chosen animation for my idle jump.

Setting up the Animator:

Once you drag the Animation clip into the Animator, you want to make the transitions from the Idle to the Jumping and back again. To set the proper conditions, we need to add the Jumping = true, and Speed must be less than 0.1.

Scripting The Jump:

If you play the animation now, you would noticed that the jumping animation doesn’t start properly.

To remedy this we need to script an IEnumerator to time delay the jump action and let the jump animation go first. First create an new boolean switch for the idle jump and set the default to false. Create the new IEnumerator and set the idle jump bool to true, and play the animation. Yield return and wait for 0.2 seconds. Set the velocity to the jump height, similar to the regular the running jump.

In the Input method, we are going to change up a bit of the script, first we set the running jump in its own IF statement, and have the else statement start the coroutine.

Now when you play the animation now it will look like this.



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
Simon Truong

Simon Truong

A Designer, an Illustrator and a massive tech geek aspiring to become a professional Unity Developer.