Using the Animation Override Track in Timeline
Objective: To learn how to use the Animation Override Track feature in Unity’s Timeline.
Following on from the Character Animations in Timeline article, let’s now take a look at how to use the Animation Override Track feature in Timeline.
You will only find this when you right-click on the ‘Animation Track → Add Override Track’:
Notice that when we create the Override Track — ‘Override 0’, it is linked to the Animation Track itself and not bound to a specific game object. This means that the Override Track is linked to the same game object as the Animation Track.
Why Use an Override Track?
Let’s use a practical example to understand why.
E.g. If you had an Animation (idle) that’s total play length was say 5 seconds, but during this you wanted to have another animation override this and play out before heading back to the idle animation, this would work great. Let’s take a look at how to set this up.
How to Use the Override Track
As seen above, when you have your Animation Track in Timeline, you are able to right-click on it and add the Override Track. From here make sure you have your animation track that you want to override.
Add the Override Track in. I have simply dragged and dropped a joyful jump animation into the Override Track section. Make sure that your animation ‘Rig’ is also set to Humanoid if your model rig is set to ‘Humanoid’, if it is still ‘Generic’ it won’t pick up the Override Track (as I have just tested).
As we can see, the joyful jump animation overrides the hip hop dance, before transitioning back into the hip hop dance.
Problem with Blending
Now, you might also notice that there is a problem with this. There is no Blending available to make this a smooth transition in and out. However, we are able to ‘Ease In/Out’ and by holding down the ‘Ctrl’ button on the left and right side of the animation clip and dragging it in:
In all honesty this has turned out pretty well! The animations seem to blend in well together and I haven’t needed to make any more adjustments.
This Isn’t Always the Case
However, this isn’t always the case. If your animation had a movement walk in it and it moved away, watch what happens when the Override Track kicks in:
You might be able to resolve this using the Clip Transform Offsets (Move/Rotate tool) on the Override Track:
Using an Avatar Mask to Only Apply an Animation Override to the Top Half of a Model
Another cool feature of the Override Track is the ability to use an Avatar Mask which you can use to switch on/off different body parts of a rig so that when the override animation plays, you might only want the chest/arms/head to play the override animation.
Let’s Add an Avatar Mask
While we have the Override Track highlighted, you will see that in the Inspector it is looking for an Avatar Mask:
So within our Project window, let’s right-click → Create → Avatar Mask. Name this whatever you like and then add it into this field.
Next, while having the newly created Avatar Mask highlighted in the Project window, head over to the Inspector and click on the ‘Humanoid’ drop down box. This will bring up the Avatar mask:
We can actually click on these body parts and turn them off!
So go ahead and click on the legs, round disc the avatar is standing on and the IK’s down the bottom right and left, so it should look like this:
So now when we run the animations again, the Override Track will still run but it will only apply to the green body parts of the Avatar Mask, so we should see Mousey throw his hands up in the air but he shouldn’t jump off the ground:
Perfect!