2D Animation and Physics
Since Unity 4.6 in 2014, Unity has shipped with dedicated 2D features, and in this chapter, we will present a range of recipes that introduce the basics of 2D animation to help you understand the relationships between the different animation elements.
In Unity 2D, animations can be created in several different ways – one way is to create many images, each slightly different, which give the appearance of movement frame by frame.
A second way to create animations is by defining keyframe positions for individual parts of an object (for example, the arms, legs, feet, head, and eyes) and getting Unity to calculate all the in-between positions when the game is running:
Figure 8.1: Overview of animation in Unity
Both sources of animations become animation clips in the Animation panel. Each animation clip then becomes a state in an Animator Controller State Machine. We can also duplicate states based on animation clips, or create new...