From the course: Advanced Unity 2D: Platformer Player Movement

Unlock the full course today

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

Adding the ducking animation

Adding the ducking animation - Unity Tutorial

From the course: Advanced Unity 2D: Platformer Player Movement

Start my 1-month free trial

Adding the ducking animation

- So now that we have our Duck logic in place, let's add this new component to our player and let's connect up all the buttons. We'll select the player instance and we'll the component Duck and now we'll need to configure it. Here, we'll have the input buttons. And here, we'll change the size to 1. We'll set the button to Down, and we'll leave the scale and everything else as is for right now. Next, we'll need to remap the Down button inside of our input manager. Let's select the input manager, we'll close out some of these that we've already mapped, and let's create a new element in this array which is going to copy over from our jump. In this case, we're going to want actually change this to the vertical axis. Next, we're going to want to map this to the Down button and we're going want to make sure that it's less than 0. Now, if we save our changes and run our game, we should be able to to Duck. Let's zoom into the player by double clicking on him in the hierarchy and give the game…

Contents