[UE5] Motion Matching 101: Run the Sample and Learn How Stopping and Turning Work

Created: 2026-07-23Last updated: 2026-09-06

A Motion Matching introduction that runs the Game Animation Sample and observes stepping off, hard stops, and direction changes. Illustrates Pose and Trajectory and the mechanism that picks motion, plus how to read the sample's contents and hand motion to your own character.

You run a character and release the key. Taking one step out to stop already reads as motion with weight. Turn around mid-run and you want them to plant a foot and cut back.

Motion Matching is one way to build these "seams between motions". It searches the animation you provide for the part matching the current pose and heading and plays it.

Start by running Epic's official Game Animation Sample (GASP) . This article observes footwork, then reads how the mechanism works, and finally shows how to hand motion to your own character.

A character stepping off, stopping hard, and turning, with attention on the seams between motions

What You'll Learn

  • How to run the Game Animation Sample and feel the differences
  • The two cues, Pose and Trajectory
  • How Motion Matching picks the next motion
  • Choosing between it and a State Machine

Target version : the steps and specific asset names in the text are based on GASP for UE5.6. A 5.8 release appeared in August 2026, updating some characters and animation structure. Using another version, consult that version's in-sample notes too.

Sponsored

Run the sample first

GASP is a free sample project for learning how locomotion animation works. It contains over 500 animations and characters that walk, run, and jump using them.

  1. On Fab, open "Game Animation Sample" from the provider "Epic Games" and add it to your library.
  2. Find the sample under "Unreal Engine → Library" in the Epic Games Launcher and create a new project with "Create Project". Confirm the supported UE version and the save location.
  3. Open the created project and wait for loading and shader preparation to finish.
  4. Open "DefaultLevel", press "Play", and click the game screen. If another map opened, search for "DefaultLevel" in the Content Browser.

Size varies by distributed version, so check what is shown when downloading. Acquiring from Fab is also covered in the asset import article.

Acquiring on Fab, creating a project on the supported version, and playing DefaultLevel

In the UE5.6 sample, W / A / S / D moves and the mouse controls the camera. Left Ctrl toggles walking and running. "View Controls" in the map also lists the controls.

Success is simply the original character walking and running. Making this your baseline narrows down causes later when a setting change breaks something.

Watch the feet and the difference shows

Without vaulting obstacles, trying these three things on flat ground shows you what to look for.

What to tryWhat to watch
Move from a standstillHow it takes the first step
Run, then release the keyWhere it plants a foot to stop
Change direction sharply while runningWhether it turns through or plants and cuts back
Observing footwork across stepping off, stopping, and cutting back

If it is too fast to see, walk onto the floor panel labeled "Game Animation Widget" in the map to open the tuning widget. Try setting "Timescale" below 1. Timescale is how fast time advances , with 1 as normal. Slowing it down makes the order of footfalls easier to follow.

Next, enable "Trajectory" under "Draw". The movement trajectory appears around the character. Change direction and release keys, comparing the line's heading and length against the character's motion. Return Timescale to 1 when done.

That Trajectory is information representing the path of movement. The part ahead in particular is a path predicted from input and velocity. The next section covers why it is used for choosing motion.

What does Motion Matching use to choose?

To turn right, picking a right-turn animation seems obvious. But the playback point that connects naturally differs depending on whether you just planted the left foot or are mid-swing on the right.

That is where Pose comes in — "the body's posture at a given instant". Beyond feet and hip positions, which way things are moving is a cue too. Combined with the Trajectory above, the motion you want can be expressed like this.

"Which motion connects well from the current footwork and turns right from here?"

Motion Matching searches the candidate animations for a part matching that condition. Rather than "always play the right-turn clip from the start", the point is that it can also pick a well-connecting point in the middle of a clip .

Picking a point mid-clip from candidate animations based on the current pose and predicted path

It switches to the chosen motion by blending , mixing poses. It also continues the current playback sometimes, so it does not always jump to another clip. The search interval is configurable too, so you need not memorize "it always re-searches every frame".

Also, without material for stopping, searching alone will not produce a great hard stop. What motion you make selectable determines the look. Being able to try that material and the driving mechanism together is what makes GASP handy.

Note that the sample's final look also includes corrections such as foot planting and body lean. Rather than crediting everything you see to Motion Matching, view it as "the mechanism that picks material" combined with "the mechanism that refines the chosen motion".

Sponsored

Peek briefly inside the sample

Let's organize the motion-choosing mechanism with a diagram. We build nothing new here, only open what is finished and look.

Chooser narrowing candidates and Motion Matching picking the playback point using the Schema's comparison settings
NameRole
Pose Search DatabaseWhere you register the animations used as search candidates
Pose Search SchemaThe settings for what to compare, such as foot positions and path
ChooserThe mechanism narrowing the candidate set by conditions like "want to walk" or "in the air"
Motion Matching nodePicks the motion to play using the narrowed candidates and search conditions

You would not want running motion chosen when you want to walk, for instance. Narrowing to walking candidates with the Chooser first, then picking a well-connecting point among them with Motion Matching, separates the roles.

Look at the registered motions

Open this folder in the Content Browser.

Content/Characters/UEFN_Mannequin/Animations/MotionMatchingData/Databases

Open one Pose Search Database inside and preview animations selected from the "Asset List". What is listed there are the candidates when searching for motion. Look at material including starts and stops, not just continuous walking.

Look at what picks candidates

Open "ABP_SandboxCharacter" in Content/Blueprints and find the "Motion Matching" node in "AnimGraph". An Animation Blueprint (AnimBP) is the blueprint assembling a character's pose.

Opening the function from the magnifying glass beside the node's update logic "Update_MotionMatching" traces the logic picking candidates with "Evaluate Chooser". The related "CHT_PoseSearchDatabases" lives in the "MotionMatchingData" folder from earlier.

You do not have to decode every node at first. Finding "where the material goes" and "what picks from it" is enough for now. Save changing settings for once you can see which role is which.

Hand motion to your own character

With the mechanism in view, you will want to try your own character. Here, as an application, we show passing the pose computed by the original character to your character at runtime . That is called runtime retargeting .

IK Retargeter is what moves motion onto a character with a different skeleton. It holds mappings such as "the source arm's motion goes to which arm on my character". Referring to the retargeting article first, build an IK Retargeter from the sample's "UEFN_Mannequin" to your character and confirm it moves in the preview.

This section proceeds from that IK Retargeter existing. The diagrams below call it "RTG_UEFN_to_MyCharacter". The setup builds a small AnimBP for your character and specifies the IK Retargeter there.

Passing the pose computed by the original mesh to your character with an IK Retargeter

1. Build an AnimBP for your character

Create one via "Add → Animation → Animation Blueprint" in the Content Browser, specifying your character's Skeleton asset, and name it "ABP_MyRetarget". Right-click in the AnimGraph, add "Retarget Pose From Mesh", and connect it to "Output Pose".

Retarget Pose From Mesh → Output Pose

"Retarget Pose From Mesh" is a node that retargets and receives another mesh's pose. Select the node, enable "Use Attached Parent", and specify your prepared IK Retargeter in "IKRetargeter Asset".

Use Attached Parent makes the mesh attached as the parent the motion source. The next step builds that parent-child relationship. Compile and save the AnimBP.

Connecting Retarget Pose From Mesh to Output Pose and specifying the parent mesh and IK Retargeter

2. Add your character as a child of the original mesh

  1. Right-click the sample's playable character "CBP_SandboxCharacter", create a child Blueprint with "Create Child Blueprint Class", and name it "CBP_MyCharacter". A child Blueprint inherits the original movement logic and lets you add visuals and more.
  2. In the opened Blueprint's "Components", select the original "Mesh (CharacterMesh0)" and add a Skeletal Mesh component from "Add". Name it "MyMesh". If it is not a child of Mesh, drag MyMesh onto the original Mesh to parent it.
  3. Specify your character's Skeletal Mesh on "MyMesh". Set "Animation Mode" to "Use Animation Blueprint" and "Anim Class" to "ABP_MyRetarget".
  4. Adjust MyMesh's relative Transform — its position, rotation, and scale as seen from the parent. Start with position and rotation at 0 and scale at 1 and confirm the feet and facing overlap the original mesh. If the model is offset, keep it visible while adjusting.
  5. Turn "Visible" off on the original Mesh only and set "Visibility Based Anim Tick Option" to "Always Tick Pose and Refresh Bones". Leave MyMesh visible.
Putting MyMesh under the original Mesh, with the invisible source still updating its pose

The original Mesh keeps working as the motion source even when invisible. That last setting means "update the pose and bone positions even when not displayed". Do not delete the original animation settings or swap the original mesh itself.

3. Register it on the sample's switch button

After compiling and saving "CBP_MyCharacter", open "Game Animation Widget" in Content/Widgets . In "Designer", duplicate an existing character-selection button, specify "CBP_MyCharacter" in the Details' "Object", and save.

Duplicating a character selection tile and registering your character's Blueprint in Object

Play and choose the added character from the widget's "Character Override". Repeat the earlier "move, stop, change direction" and success is your character moving with the original no longer displayed . If foot positions or the pose break, return to the IK Retargeter's preview and check there first.

Bringing the whole sample into your own game also needs combining with input, camera, and character movement logic. This swap only goes as far as moving your character inside the sample.

Sponsored

How does it compare with a State Machine?

Which to use is not decided by whether your character is realistic or stylized. Think about what kinds of motion you need and how you want to pick that material .

A State Machine builds states such as "idle" and "moving" plus the conditions for switching. A Blend Space mixes walking and running by a value such as speed. Basic construction is covered in the AnimBP article.

What you want to buildExample approach
Idle, walk, and run switching that you understand as you build itStart from a State Machine and Blend Space
You have starting, stopping, and cutback material and want the fitting partTry Motion Matching
Playing a specific attack even while movingCombine a Montage with your locomotion setup

A State Machine can also produce smooth motion with the right material and transitions. Motion Matching is the option that does that motion choosing by search. Newer GASP releases also include setups combining State Machines and Blend Spaces.

A State Machine where you build states and conditions yourself versus Motion Matching searching material for a fitting part

To add actions once locomotion works, continue to the Animation Montage article. A Montage plays attacks and the like at the timing you need. How locomotion and attack poses mix is also settled on the AnimBP side.

Where to look when it does not work

SymptomWhat to check first
You cannot find the asset names in the textThe UE and GASP versions. Whether you are looking for 5.6 names in another version
Pressing keys does nothingWhether you clicked the game screen during Play. What View Controls in the sample says
Your character stays in a T-poseMyMesh's Anim Class, compiling the AnimBP, whether the parent is the original Mesh, the IK Retargeter specification
Hiding the original mesh stops motionThe original Mesh's "Always Tick Pose and Refresh Bones"
Feet or arms are oriented wrongThe IK Retargeter's source and target, bone mapping, the reference pose
Choosing your character still shows the originalWhether the switch button's Object is CBP_MyCharacter. Whether you saved the Widget

When your character trips something up, switch back to the original and try the same actions. If the original does not move either, the sample's controls or settings are at issue; if only yours breaks, it is around retargeting.

Bonus: good to know up front

  • Run the sample standalone first : the Game Animation Sample works differently from Third Person. Moving it wholesale into your own project immediately tends to stall on missing references and plugins
  • Replacing one node does not make it work : you need the Pose Search settings, the Animation Blueprint, the Database, and the locomotion animation set. It does not drop in the way swapping part of a State Machine does
  • Start from the skeleton when bringing it over : moving it onto your character means confirming skeleton compatibility, retarget settings, the character's facing, the origin's position, and consistency with the capsule. Mismatches here show up as "sliding", "feet sinking", and "wrong facing"
  • You need not abandon State Machines : for games with few motion types, the traditional approach can be easier to tune

Summary

Motion Matching searches the animation you provide for the fitting playback point, using the current pose and predicted path as cues. Running GASP while observing "it plants a foot here" and "this step changed the facing" shows what the mechanism is choosing for.

Try moving, stopping, and turning with the original character first. Then find where the material lives and what picks from it, and hand motion to your own character. Proceeding in that order lets you work through even a large sample one step at a time.

Further Reading

Unreal Engine Notes in this section98