Character Animations in Timeline
Objective: Use Timeline to use Character Animations.
In Unity we have the animator that helps control animations based on parameters. This would be difficult if we were trying to make a cut scene. To make things easier, we can use the same animation but with Timeline instead. We will have a Director empty object and the Character as a child.
We’ll create a Timeline to run multiple animations for one character.
Now all we have to do is pull in the different animations.
Make sure that the Character that is going to be used is in the Animation target.
If play is hit now, we will see how sharp the animations are when they change.
To fix this we can have the animations blend with each other.
Just by dragging them into each other, we can achieve a smoother transition between the animations.
The last thing to fix is how after the right turn the character faces back left to start walking backwards. To fix this we just right click the Walk backwards animation and select Match Offsets To Previous Clip.
With that one click the character will keep its current rotation and move back from there.
Another thing we can do with Timeline is add overrides. The override animation will override the current animation. To enable the override track, right click the current animation track and select Override track.
In the Override track drop the animation in where you would like.
Using the override will push the character back to the original spot. We can’t use Match Offset to previous clip with override tracks.
There are two ways to fix this. One is to use the Clip Transform Offset tools. Select the move to line up the character to the right spot and rotate key to rotate in the right direction.
The other is to use a Avatar Mask. To create one, in the project window, right click → Create → Avatar Mask.
With the Avatar Mask selected, we can either use the Transform or Humanoid. I’ll be using the Humanoid. Deselect both legs, position, and both feet IK.
This will keep the legs and position from overriding the walking back animation. Now with the Override selected, add the mask into the reference.
We can see that the upper body will do the punch while the lower half keeps walking.
Thank you for reading and have a wonderful day!