Mixing animations with Layers and Masks
Mixing animations is a great way of adding complexity to your animated characters without requiring a vast number of animated clips. Using Layers
and Masks
, we can combine different animations by playing specific clips for specific body parts of the character.
In this recipe, we will apply this technique to our animated character, triggering animation clips for firing a rifle and throwing a grenade with the character's upper body. We will do this while keeping the lower body moving or idle, according to the player's input.
Getting ready
For this recipe, we have prepared a Unity Package named Mixing
, containing a basic Scene that features an animated character. We have also provided the FBX animation clips Swat@firing_rifle.fbx
and Swat@toss_grenade.fbx
. These files can be found in the 09_03
folder.
How to do it...
To mix animations using layers and masks, follow these steps:
- Create a new 3D project and import the
Mixing
Unity Package, as well as the FBX...