Animation Syncing
Overview
Animation Syncing supports Scale-based Syncing and Marker-based Syncing. It can reduce the jumps when two animations are blended. For example, when switching from walking to running, applying Animation Syncing will synchronize the feet placement of both animations.
Scale-based Syncing
Scale-based Animation Syncing can be implemented by adding the same Sync Group.
Scale-based Syncing can solve the problem of syncing animations of different lengths. Animations in the same Sync Group are played according to the same scale values. For example, when animations of different total lengths are played and one of them reaches half of its length, the other animation will also reach half of its own length. This solves the problem of feet-out-of-sync due to different lengths when blending animations, and makes animations blend more naturally.
Open the animation assets that need to be synced in the Animation Editor, and enter the same name in the Sync Group of the Asset Details panel to make these animations into the same group.
Note:
- Animations using the Sync Group need to have similar actions.
- Animations in the same group should not differ too much in length.
Set the same name in the Sync Group of the Asset Details panel of both the animation sequence assets walking and running.
In the Animation Tree Editor, create a State Machine node and connect it to the Final Animation Pose node. Double-click it to enter the state graph of the node and create a state transition from walking to running. Refer to State Machine Nodes for State Machine related operations.
Double-click the State node walk to add a Sequence Playback node walk and connect it to the Final Animation Pose node.
Double-click the State node run to add a Sequence Playback node run and connect it to the Final Animation Pose node.
Add a float parameter Speed in the Animation Parameter window.
Set the state transition rule of walk→run as: Speed is Greater than 0.1.
Set the state transition rule of run→walk as: Speed is Less than 0.1.
At the top of the Anim Tree Editor, switch from Init Object to Preview Object for previewing effects later.
After clicking Apply, the states are switched by entering different values in Parameter Instance Value in the Animation Parameter window. Refer to the state transition rule setting for the value input.
Marker-based Syncing
In addition to Scale-based Syncing using the Sync Group, the Engine is also equipped with Marker-based Syncing.
You can set the Sync Marker at Notifies of the animation asset in the Animation Editor. Add Sync Markers at the same actions in different animations, and the animations will be synced according to the same Sync Markers when playing the animation.
Right-click the Notify track in the Animation Editor to open the Shortcut Menu, then select Add Sync Marker -> New Sync Marker, enter the Sync Marker Name in the pop-up New Sync Marker window and click the OK button to finish the creation.
Note: Make sure that animations using Sync Markers are in the same Sync Group since the Engine only matches the same Sync Markers in the same Sync Group. Add the corresponding Sync Markers at the same actions (when both feet land) in the walking and running animations according to the above method.
Place the two animations in the same Sync Group in the Asset Details panel.
After saving all the set animation assets, you can switch states in the Anim Tree Editor to see the effects after syncing.
Effects
Sync Marker and Sync Group Off:
Sync Group On:
Sync Marker and Sync Group On: