Version: 2017.4
Converting an Infinite clip to an Animation clip
Using Animation Override Tracks and Avatar Masking

Creating humanoid animation

This workflow demonstrates how to use a Timeline Instance to animate a humanoid character with external motion clips. This workflow also demonstrates how to match clip offsets, manually adjust clip offsets, and create blends between clips to minimize jumping and sliding. Although this workflow uses a humanoid character, you can use this animation method for any GameObject.

This workflow assumes that you have already created a Timeline instance with an empty Animation track bound to a humanoid.

For example, the Guard humanoid is bound to an empty Animation track
For example, the Guard humanoid is bound to an empty Animation track

From your project, drag a motion clip into the Animation track to create a new Animation clip. For example, drag an idle pose as the first clip to start the humanoid from an idle position. Position and resize the idle clip as appropriate.

Animation track, bound to the Guard humanoid, with an idle pose (Idle) as its Animation clip
Animation track, bound to the Guard humanoid, with an idle pose (Idle) as its Animation clip

Add a second motion clip. In this example, a run and turn left clip (named Run_Left) is dragged onto the Animation track. Resize the Run_Left clip as appropriate. In this example, the Run_Left clip is resized to include one loop so that the Guard runs and turns 180 degrees.

Animation track with an Idle clip and a Run_Left clip
Animation track with an Idle clip and a Run_Left clip

Play the Timeline instance. Notice that the humanoid, Guard character, jumps between each Animation clip. This happens because the position of the humanoid character at the end of the first Animation clip (Idle) does not match the position at the start of the next Animation clip (Run_Left).

The humanoid jumps between the first Animation clip, that ends at frame 29 (red arrow and box), and the second Animation clip, that starts at frame 30 (ghost with green arrow and box)
The humanoid jumps between the first Animation clip, that ends at frame 29 (red arrow and box), and the second Animation clip, that starts at frame 30 (ghost with green arrow and box)

To fix the jump between clips, match the offset of each Animation clip. The Timeline Editor window provides a few different methods for matching offsets. In this example, the second Animation clip is matched with the previous clip. To do this, select the Run_Left clip, Right-click and select Match Offsets to Previous Clip.

Right-click and select Match Offsets to Previous Clip to match the offsets of the selected Animation clip with the preceding Animation clip
Right-click and select Match Offsets to Previous Clip to match the offsets of the selected Animation clip with the preceding Animation clip
After matching offsets, the humanoid at the end of the first Animation clip (frame 29, red arrow) matches the position and rotation of the humanoid at the start of the second Animation clip (frame 30, ghost with green arrow)
After matching offsets, the humanoid at the end of the first Animation clip (frame 29, red arrow) matches the position and rotation of the humanoid at the start of the second Animation clip (frame 30, ghost with green arrow)

Play the Timeline instance again. Although the position and rotation of the humanoid matches, there is still a jump between the two Animation clips because the humanoid is in different poses. At the end of the first Animation clip, the humanoid is standing upright with its feet together. At the start of the second Animation clip, the humanoid is bent forward with its feet apart.

Create a blend to remove the jump and transition between the two poses. Adjust the size of the clips, the Blend Area, the Clip In, and the shape of each Blend Curve to create a transition between the two poses. For example, in the transition between the Idle clip and the Run_Left clip, the Idle clip is changed to a duration of 36 and the Run_Left clip is repositioned to start at frame 25. The rest of the properties are left as their default values.

Create a blend between the first two clips to create a smooth transition between the two animations
Create a blend between the first two clips to create a smooth transition between the two animations

As the Idle clip transitions to the Run_Left clip, the blend removes the obvious jump between poses and transitions between most body parts naturally. However, blending between the different positions of the foot results in an unnatural foot slide.

To fix foot sliding, you can manually adjust the root offset of an Animation clip so that the position of the foot changes less drastically, reducing the foot slide. To manually adjust the root offset, select the Animation clip in the Timeline Editor window. In the Inspector window, expand Animation Playable Asset and expand Clip Root Motion Offsets.

Select an Animation clip. In the Inspector window, expand Animation Playable Asset (advanced properties) and expand Clip Root Motion Offsets.
Select an Animation clip. In the Inspector window, expand Animation Playable Asset (advanced properties) and expand Clip Root Motion Offsets.

The Clip Root Motion Offsets, both position and rotation, are not zero because performing Match Offsets to Previous Clip already set these values to match the root (hips) of the previous humanoid at the end of the previous Animation clip.

Under Clip Root Motion Offsets, enable the Move tool. The Move Gizmo appears in the Scene view, at the root of the Animation clip. Use one of the following methods to manual adjust the root offset position of the Animation clip:

  • In the scene view, drag the Move Gizmo.

  • In the Inspector window, change the value of the appropriate Position property.

Enable the Move tool (Inspector window, blue arrow) to show the Move Gizmo (red arrow) in the Scene view. Use the Move Gizmo to manually position the root motion offset of the selected Animation clip.
Enable the Move tool (Inspector window, blue arrow) to show the Move Gizmo (red arrow) in the Scene view. Use the Move Gizmo to manually position the root motion offset of the selected Animation clip.

  • 2017–12–07 Page published
Converting an Infinite clip to an Animation clip
Using Animation Override Tracks and Avatar Masking
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961