No matter how much animation coverage you have, it is extremely unlikely that you will find a pose trajectory that perfectly matches your desired trajectory. The difference between the desired and current trajectory is called the ‘Trajectory Error’. The green trajectory shown below is the desired trajectory and the red is the current pose trajectory.
If you are using root motion to move your character then this present a serious problem where the character does not move exactly in the direction that the user desires and this must be rectified. Essentially we can rotate the character over time on the Z axis so that the red trajectory aligns with the green one and the character runs in the correct direction. This is called ‘Trajectory Error Warping’ and Motion Symphony comes with an Actor Component that can do this for you.
Step 1: Add the ‘TrajectoryErrorWarping’ actor component to your character blueprint as shown below
Step 2: In your event graph, during your regular update phase (Tick in this case), call ‘ApplyTrajectoryErrorWarping’ on the warping component.
Note: The trajectory error warping does not tick on it’s own. It is designed so that you can choose when to update it. You may not want to update it in specific circumstances, especially if you are not using motion matching in any particular states.
Step 3: Adjust warp settings in the component’s details panel to get the desired effect
Component Details Panel
The settings of the trajectory error warping component can be modified to change it’s behaviour.
Warp Mode - How warping should behave:
Disabled - Warping will not occur
Standard - Warping will be applied based on the error in trajectory positions. This should be used for any locomotion set where the character turns to follow the direction they are moving.
Strafe - Warping will be applied based on the error in trajectory facing. This should be used for any locomotion set where the character is strafing.
Warp Rate - How fast the warping should be applied. Measured in ‘degrees / second’
Min Trajectory Length - The minimum length of the trajectory (cm) for warping to occur. Warping will not be applied if the overall trajectory length is less than this amount.
Error Activation Rage - The angle range (in degrees) that error warping will activate. If the error angle is beyond this range, no warping will occur and it is expected that a motion matched animation will be triggered to cover the discrepancy. (A minimum value of 0.01 is recommended as warping is not necessary required with such a small error)