Quick answer: Enable IK Pass on the animator layer and implement OnAnimatorIK to pin the foot to the ground via SetIKPosition. For specific animations (jumps, climbs), call animator.MatchTarget with the AvatarTarget and a normalized time window.

Character runs forward. Each foot strike slides the character a couple inches before planting. Or transitions between idle and run leave the character’s feet hovering through space mid-blend. Mecanim has two tools for this: Foot IK (passive, every frame) and MatchTarget (active, per event).

The Symptom

Feet visibly slide during animation playback. Worst at transitions between locomotion states, during ground contact in jumps, or when running on uneven terrain.

The Two Fixes

Fix 1: Foot IK (always-on for humanoid). On the animator layer (Base Layer or whichever holds locomotion), tick “IK Pass.” Implement OnAnimatorIK on the same GameObject:

public class FootIK : MonoBehaviour
{
    public Animator animator;
    public LayerMask groundMask;

    void OnAnimatorIK()
    {
        PlantFoot(AvatarIKGoal.LeftFoot,  "LeftFoot");
        PlantFoot(AvatarIKGoal.RightFoot, "RightFoot");
    }

    void PlantFoot(AvatarIKGoal goal, string weightParam)
    {
        var w = animator.GetFloat(weightParam);
        animator.SetIKPositionWeight(goal, w);
        animator.SetIKRotationWeight(goal, w);

        var footPos = animator.GetIKPosition(goal);
        if (Physics.Raycast(footPos + Vector3.up, Vector3.down, out var hit, 2f, groundMask))
        {
            animator.SetIKPosition(goal, hit.point + Vector3.up * 0.05f);
            animator.SetIKRotation(goal, Quaternion.FromToRotation(Vector3.up, hit.normal) * animator.GetIKRotation(goal));
        }
    }
}

Define LeftFoot/RightFoot float curves in the source clips that go 0 (off) to 1 (planted). The script reads those curves and pins the foot when planted.

Fix 2: MatchTarget for specific events. A jump animation that should land at a specific point:

public void JumpToLedge(Vector3 ledgePoint)
{
    animator.SetTrigger("Jump");
    animator.MatchTarget(
        ledgePoint,
        Quaternion.identity,
        AvatarTarget.LeftHand,
        new MatchTargetWeightMask(Vector3.one, 0),
        0.2f,   // start (normalized clip time)
        0.8f);  // end
}

Mecanim gradually adjusts the rig over the [0.2, 0.8] window so the left hand lands exactly at ledgePoint. Use this for traversal animations where the precise landing matters.

Choosing

Use both. Foot IK handles the 90% case; MatchTarget rescues the 10% where IK alone can’t fix it.

Verifying

Walk and run the character on flat and uneven ground. Feet should plant cleanly without sliding. Transitions between locomotion clips should feel grounded. Use Animator window in PIE; the LeftFoot/RightFoot weight values should ramp 0→1 around foot strikes.

“Foot IK for the loop. MatchTarget for the climb. The character plants instead of slides.”

Related Issues

For animator transition skipped, see transition skip. For root motion not applying, see root motion.

IK Pass. MatchTarget. Feet plant.