Using scripts to control 3D animations (old input system)
In the previous recipe, we created a simple transition in our Animator Controller from Entry to the Idle animation. However, when we control a character, we will want it to run different animations depending on our inputs – idle, walking running, jumping, and so on. Different events will determine which animation clip we want our character to execute – such as pressing the WASD-SPACE keys or changing from a walking animation to a running one depending on our character’s speed of movement, and so on.
Unity has two input systems. The old input system works fine, however, the new input system adds more abstraction between devices generating input events (such as keyboards, mice, game controllers, etc.) and the code that responds to actions indicated by those input events. In this recipe, we’ll use the old input system, and in the recipe that follows, we’ll explore how to use the new input...