---
id: "motion-matching"
title: "Motion matching"
domain: "simulation"
stage: "simulation"
realtime: "realtime"
platforms: [cpu, unity, unreal, godot]
year_introduced: 2016
inputs: [animation, skeleton]
outputs: [animation, skeleton]
style: "both"
dynamic: "dynamic"
cost: "medium"
authority: "Clavet"
url: "https://texelatlas.vercel.app/t/motion-matching/"
sources_verified_at: "2026-11-29"
---
# Motion matching (Clavet)

> Chooses the next animation pose by searching a mocap database for the clip frame whose pose, velocity and predicted trajectory best match the current state and desired motion.

## Reach for it when

- character locomotion looks stiff with state machines
- too much hand authoring of animation transitions
- want responsive natural movement from mocap data
- pick the best mocap pose for the desired path

## How it works

Offline, an animation database is built from mocap: every frame gets a feature vector (joint positions and velocities, root velocity, future trajectory samples). At runtime a query vector is built from the character's current pose and the controller's desired trajectory. The nearest database frame under a weighted distance is found (brute force, KD-tree or accelerated search), and playback jumps to it if it is better than continuing the current clip by some margin. Inertialisation blends away the transition. Feature weights and search frequency are tuning knobs. Learned motion matching replaces the database search with neural networks to cut memory.

## When to use it

Choose it for responsive, natural locomotion and action animation with little authoring of state machines. Prefer authored state machines or blend trees when you need guaranteed timing and exact poses, [FABRIK inverse kinematics](https://texelatlas.vercel.app/t/fabrik-ik.md) for adding foot/hand IK corrections on top, and physics-based control ([MuJoCo articulated-body dynamics with convex contacts](https://texelatlas.vercel.app/t/mujoco-articulated-dynamics.md)) when the character must react to forces.

## Cost

medium — Search cost scales with database size; usually sub-millisecond per character with acceleration.

## Failure modes

- Missing transitions in the data show up as foot sliding or 'teleporting' poses
- Large databases need memory and careful curation
- Feature weights are fiddly; poor tuning gives twitchy switching
- Data-driven: cannot produce motion absent from the mocap

## Engine support

- unreal: official — `Enable the Pose Search plugin; Animation Blueprint > Motion Matching node with a Pose Search Database` (evidence: https://dev.epicgames.com/documentation/en-us/unreal-engine/motion-matching-in-unreal-engine, checked 2026-12-01)

## Dataflow

- Inputs: animation, skeleton
- Outputs: animation, skeleton
- Platforms: cpu, unity, unreal, godot

## Combines with

- [FABRIK inverse kinematics](https://texelatlas.vercel.app/t/fabrik-ik.md): Motion matching outputs the base pose; IK adjusts feet and hands to terrain and targets

## Combination ideas

- [A motion-matching database without mocap](https://texelatlas.vercel.app/ideas/physics-generated-motion-database/)

## Sources

1. [primary] Simon Clavet Motion Matching and The Road to Next-Gen Animation. GDC 2016. https://www.gdcvault.com/play/1023280/Motion-Matching-and-The-Road (verified via http on 2026-11-29)
2. [primary] Daniel Holden, Oussama Kanoun, Maksym Perepichka, Tiberiu Popa (2020) Learned motion matching. ACM Transactions on Graphics. https://doi.org/10.1145/3386569.3392440 (verified via crossref on 2026-11-29)

## Cite this entry

Texel. "Motion matching." https://texelatlas.vercel.app/t/motion-matching/ (accessed 2026-12-01).
