How it works...

This recipe has a few key elements that make it work:

  • Layers: Animator Controller Layers are useful for overriding animations. The Blending drop-down menu in the Layer Properties defines the type of animation blending. We can override the animations or use additive blending (this will be covered in the next chapter).
  • Layer Weight: When blending Layers, Unity takes the Weight parameter into account. A weight of 1 means 100 percent override. You can set the Weight in runtime by using the animator.SetLayerWeight(int index, float weight) function (animator is a variable that holds the reference to the Animator component).
  • Avatar Masks: We can create an Avatar Mask asset and specify the body parts on which we want to play an animation. Then we can use this Avatar Mask in our Layers to override only certain body parts' animations. This way we can play the AimForward animation on the upper body and not on the legs and root. This makes the character move while playing the AimForward animation.
..................Content has been hidden....................

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