PixPoly
All videos

Animation Blueprint in Unreal Engine 5: idle, start, cycle and stop that chain cleanly

8:32

Four states, one State Machine, one variable. Then the settings that make all the difference: acceleration tuned to the animations, syncing through markers, and the two classic start-stop bugs.

The character moves, but slides along the floor. This episode sets up the first half of the Animation Blueprint: standing still, starting, running in a loop and stopping — and above all what to tune so the four chain without a hitch.

Importing the animations

  1. 1Drag the animation folder into the project, checking that Import Only Animation is ticked and the right skeleton is selected.
  2. 2Open every run animation and tick Enable Root Motion and Force Root Lock.
  3. 3Enable the Animation Warping and Animation Locomotion Library plugins.

These two plugins bring nodes we will use later — Offset Root Bone, Foot Placement — but also the sync modifiers we need in this very episode.

The State Machine, in four states

Create the Animation Blueprint pointing it at the Skeletal Mesh, then assign it to the character in Mesh ▸ Details ▸ Animation Class. Two places matter in this class: the AnimGraph, where the animations are chosen, and the Event Graph, where the variables driving that choice are updated.

In the AnimGraph, create a State Machine named Ground Locomotion — later, another one will handle the airborne states. It holds four states, wired in a loop: Idle, Start, Cycle, Stop, then back to Idle.

StateAnimationLoop
IdleStanding stillYes
StartRun startNo
CycleRunYes
StopRun stopNo

One single variable for the transitions

  • Idle ▸ Start: Is Acceleration.
  • Start ▸ Cycle: Automatic Rule Based on Sequence Player — the change happens at the end of the clip.
  • Cycle ▸ Stop: Is Acceleration with a Not.
  • Stop ▸ Idle: Automatic Rule Based on Sequence.

What is left is feeding Is Acceleration. In the Event Graph, on Event Blueprint Initialize Animation, Cast To BP_MyCharacter from Try Get Pawn Owner, and promote to variables both the character reference and its Character Movement.

  1. 1On Event Blueprint Update Animation, drop the character reference and convert it into a Validated Get.
  2. 2From Is Valid, pull a Sequence to keep the graph tidy.
  3. 3Call Get Current Acceleration on the Character Movement.
  4. 4Pass the result through Vector Length XY, then through a Greater compared to zero.
  5. 5Wire the output into Set Is Acceleration.

The Validated Get is not a flourish: it checks the cast succeeded before running the rest, and prevents both compile errors and crashes at launch.

Tuning the character to the animations

At this point the states chain, but the timing is wrong: the character picks up speed faster than its animation, and slides to a stop. The problem is not in the Animation Blueprint, it is in the Character Movement.

SettingValueEffect
Max Acceleration800How fast the character gets up to speed.
Braking Deceleration Walking1000How fast it comes to a halt.
Use Separate Braking FrictionCheckedWithout it, the deceleration value is simply ignored.

These values depend on the animations you use. They are a starting point, not gospel: test, and adjust until the start and the stop stop skating.

Syncing the animations together

The Start ▸ Cycle transition still jolts. If the end of the start matches the beginning of the cycle exactly, a transition duration of 0 seconds is enough. Otherwise, the two animations have to be synced.

  1. 1In the Start state, select the animation and, under Sync, give it a group name — locomotion, for instance — with the Sync Group method.
  2. 2Do the same in the Cycle state, with exactly the same group name.
  3. 3Open the start animation, Animation Data Layer section, and look for the sync modifier.
  4. 4Check that the bone names match your skeleton (root and feet), then run Apply Modifier.
  5. 5Repeat on the cycle animation.

Markers then appear on both animation timelines: Unreal now knows how to line up the footfalls of one with those of the other.

The two bugs to fix

First bug: if you start then release before reaching the cycle, the character never plays its stop. Simply wire Start directly to Stop, with the same condition as the Cycle ▸ Stop transition.

Rather than copying the condition, Promote to Shared on the Cycle ▸ Stop transition and reuse it: both transitions then stay in step if you change it later.

Second bug: the stop animation was designed for a character at speed. On a brief press, it does not work. The fix is a Blend Poses by Bool in the Stop state, choosing between the run stop and a walk stop.

  1. 1Create a boolean variable Use Jog.
  2. 2On the Start ▸ Cycle transition, add a notify — named StartToCycle, for instance.
  3. 3In the Event Graph, listen to that notify and set Use Jog to true.
  4. 4Do the same on the Idle ▸ Start transition to set it back to false.

The character who really ran plays the run stop; the one who only brushed the key plays the walk stop. In the next episode, we add the quick turn.