Day 116: Jump and Animation Part 2

Objective: Finish Jump animation.

As we did for the idle and run animation, with the player sprite selected we will create a new clip name Jump.

We will add in some of our sprite from the sprite sheet for the jump animation. I adjusted some of the sprites to get a better looking jump animation.

In our Animator, we will need to add transitions to the jump animation. We will have transitions from the idle and run animations.

We will create a bool for IsJumping.

For the transitions going to the Jump animation we will have Has Exit Time and Fixed Duration off and Transition Duration at 0. There will be condition of IsJumping is true.

Going back to Idle we will just check to see if jumping is false.

But for going from Jump to Run, we will need to check to see if jumping is false and speed is greater than zero.

Now we have the animator set up, we will go into our animation script. Here we will create a method to jump. We will setBool to the pass in value that we will get from our player script.

In our player we will set the jump to true when we hit space.

Currently, we have no way to set the jump bool to false. To fix this we will start a Coroutine to set the bool to false.

In the IEnumerator, we will wait a second and then set the bool to false.

Now we have an animation to go with our jump! Thank you for reading and have a wonderful day!!

--

--

--

I am passonate on learning to program and use Unity to become a skillful Unity Developer

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

Recommended from Medium

How to sign Flutter apps for iOS automatically without a Mac

Hybrid Cloud and Regulated Enterprise

Ecto with Phoenix in 4 Minutes.

7 essential step to make app in flutter

A Beginner’s Guide to Kubeflow on Google Cloud Platform

Kubernetes on bare-metal: roll your own — part 2

How to: Spring Boot and Quartz integration

Migrating to Python 3: The HealthifyMe Experience. (Part 2)

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
Tyler Smallwood

Tyler Smallwood

I am passonate on learning to program and use Unity to become a skillful Unity Developer

More from Medium

Day 117: Attack animation

Slick Orbital Camera Movements using Free Look Cameras

Layered Lit Materials In Unity HDRP

Create a Control Room Game Scene: Part 2- Game Dev Series 148