Warping Phases
A Warping Phase is a segment of the animation during which the system actively warps the character’s position and rotation. Inside the Motion Warping Asset editor, phases appear as purple draggable windows overlaid on the root motion curves.How many phases do you need?
The number of phases equals the number of target points the interaction requires. A vault animation needs three phases because three points define the interaction:- Close obstacle edge
- Far obstacle edge
- Landing point
What each phase stores
Every phase carries metadata about its animation segment:- T Offset — a translation offset applied on top of the target point. Use this to fine-tune where the character arrives within the phase, or to correct awkward poses caused by the original animation.
- R Offset — a rotation offset applied to the target point, useful for aligning the character’s facing direction at each warp target.
- Start Time / End Time — the normalised or absolute animation times that define the boundaries of the phase window. You can drag and resize phase windows interactively in the asset editor.
- Min Rate / Max Rate — clamps on the computed play rate for this phase (see Play Rate Scale below).
- Total Root Motion — the accumulated root motion for each axis across this phase (see Total Root Motion below).
The T and R Offsets are especially powerful for compensating for foot or hand placement differences that arise when the same animation is used at very different obstacle sizes.
Play Rate Scale
When the distance to a target point differs from the distance baked into the original animation, playing the animation at a fixed 1× speed produces unnatural motion — the character appears to glide or rush. To compensate, the system scales the play rate for each phase based on the ratio of actual distance to animation distance:- If the real obstacle is twice as far as the animation expects, the play rate is scaled down to 0.5× so the character takes longer to cover the extra distance.
- If the real obstacle is half as far, the play rate is scaled up to 2× so the character arrives on time.
Applying the play rate
The computed play rate is written to a float parameter in the Animator Controller. You connect that parameter to the animation state’s speed multiplier in the Animator. If you are using a custom animation system rather than Unity’s Animator, you read the value yourself and apply it to your playback speed.Total Root Motion
Every Warping Phase stores the total accumulated root motion for each translation axis across that segment of the animation. Think of it as the full distance the root bone travels in X, Y, and Z from the phase start to the phase end. This value is calculated automatically when you open (or re-open) the Motion Warping Asset in the Editor.If you edit an animation’s root motion curves after setting up the asset, close and re-open the asset to refresh the Total Root Motion values.
Post-Animation Update
All warping happens inLateUpdate(), after the Animator has evaluated for that frame. This ordering is deliberate:
- The Animator writes the root motion delta for the frame.
- Other systems (IK, constraints) run in their own
LateUpdatepasses. - Motion Warping then reads the accumulated delta and applies its offset on top, without disturbing any IK or constraint results.
Translation formula
At each frame the system computes an additional positional offset using:desiredHeightDeltais the difference between the target point position and where the original animation would place the character.accumulatedRootMotionis how much root motion has been applied from the phase start up to the current frame.totalRootMotionis the phase’s full root motion for that axis.
accumulatedRootMotion / totalRootMotion is always in the range [0, 1] and acts as a weight or alpha — the warp offset starts at zero and builds up smoothly as the animation progresses, ensuring the character arrives precisely at the target by the time the phase ends.
Rotation formula
Rotation warping does not use the root motion ratio. Instead, rotations are spherically interpolated from the character’s rotation at the start of the phase to the target rotation, using the phase’s normalised playback time as the alpha:Putting It All Together
- You author an animation and define Warping Phases that mark the segments where alignment is needed.
- At runtime, when an interaction is triggered, the system computes target points (from a Warp Provider) and compares them to the animation’s built-in root motion.
- Play Rate Scale adjusts the animation speed so the timing stays natural for the real obstacle size.
- Each frame, the Post-Animation Update uses the Total Root Motion ratio to calculate and apply the translation offset, while SLERPing the rotation, until each phase end is reached.
