From the course: Unity 4: 2D Essential Training

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Connecting up jet animations

Connecting up jet animations - Unity Tutorial

From the course: Unity 4: 2D Essential Training

Start my 1-month free trial

Connecting up jet animations

So now that we'd created our walk animation, let's connect up the jetpack animation and the animation we'll use when the player is falling or when they're out of fuel. We'll go back into the animator tab, select the player, and build a new transition from walk to jet. We'll also set up a transition, from the jet animation, back to the Idle, and the idle to the jet. This will allow us to be able to go to the jet animation from either a walking position, or an idle position. We'll select the first transition from the walk to the jet animation. We'll switch to our anim state, and we're going to set this value to two. We'll also change the idle to jet animation state, to Animstate, and we'll set this to two as well. Going back from jet to idle, we'll simply set this at zero, which is what comes up as default. Let's save our scene, and go into our player script. From here, we're going to scroll down to where we're testing moving.y is greater than zero. And we'll add in the code to switch…

Contents