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), contained in its .fbx file. Let's explore how it is assembled:

  1. Select the SimpleDrone in the Hierarchy and look at its Inspector (or the Prefab in the Project Assets/SimpleDrone/Prefab folder), you can see the component's Animator Controller is called RotorSpin, as shown in the following screenshot:
  1. Double-click the RotorSpin controller and it will open in the Animator window (the window can be docked by dragging its tab). As shown in the following screenshot, we can see the states in the controller:
  1. Click the RotorSpin state, you can see (in the Inspector) which animation the state is mapped to (in its Motion parameter).
  2. Click the Motion parameter, your Project window will go to where the animation is located. The following screenshot shows that our RotorSpin animation is a child (second from the bottom) of the QuadDrone mesh:
  1. Select the QuadDrone mesh, then you can see the animation parameters in the Import Settings' Animation tab, as shown in the following screenshot:

Since we want the rotors to spin continuously, the Loop Time checkbox is checked (if it's not, please check it now and press Apply). You can even preview the model animation by pressing the Preview Play at the bottom of the Inspector.

Now drilling down even deeper, if you want to see the RotorSpin animation clip itself:

  1. Select the RotorSpin animation file (child of QuadDrone).
  2. And then open the Animation window (main menu Windows | Animation, the window can be docked by dragging its tab).

It may default to the keyframe Dopesheet view. In the following screenshot, we switched to the Curves view and selected the Rotor_1 1 under Drone_Rig/Master/. You can see that the rotor is directed to rotate not just at a constant rate, but in an oscillating pattern that cleverly simulates a strobing pattern you might observe on fast rotating blades.

Thus, we've seen that the drone rotor blade animation is an Animator component of the SimpleDrone object, which references the RotorSpin Animation Controller (state machine graphic). That animator in turn references an imported animation, which we first examined in the FBX file Import Settings. And then we found the actual RotorSpin Animation clip, and viewed its dopesheet and curves in the Animation window.

Now let's go make one ourselves.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.138.144