Animating the drone
Creating and managing animations with Unity can be simple, or very complicated. There are several pieces that work together, including:
Animator component
: It is attached to objects that you want to animateAnimator Controller
: It is a state machine that says what animations to use and whenAnimation clips
: It describes how specific parameter values change over time
The Animator component is attached to an object in the scene and is used to assign animation to it. It requires a reference to an Animator Controller that defines which animation clips to use, and controls how to transition between the clips. Animators are used for simple objects like our drone, as well as for complex humanoid avatars.
An Animator Controller is a state machine that determines which animations are going to be played.
How do the blades spin?
In fact, our SimpleDrone
already has an Animator component that makes its blades spin. This animation was imported with the original model (for example, from Blender...