PixPoly
All videos

180° quick turns in Unreal Engine 5: detecting the change of direction and playing the right pivot

3:12

A dot product is all it takes to know the player wants to head back the other way. What is left is spinning the capsule instantly while letting the animation take its time — that is the Offset Root Bone’s job.

When the player pushes the stick the opposite way, an ordinary character spins on the spot, sliding. A AAA character plays a real quick-turn animation. Detection takes three nodes, and the look of it takes one.

Detecting the intent to turn

Create a boolean variable Attempt Turn. Two values from the character are enough to fill it.

  • Get Velocity — the direction the character is actually moving in.
  • Get Last Movement Input Vector — the direction the player has just asked for.
  1. 1Normalise both vectors: we only want to compare directions, not speeds.
  2. 2Pass them into a Dot Product.
  3. 3Compare the result to zero: below it, the two directions oppose each other.
  4. 4Wire the result into Set Attempt Turn.

The dot product answers exactly the question asked: are these two directions going the same way? Positive, and the character is broadly still heading forward. Negative, and the player wants to turn around.

The Turn state in the State Machine

The quick turn should only be possible while moving: from Start, Cycle or Stop. Rather than dragging three transitions into one state, use an Alias State — call it To Turn.

TransitionConditionDuration
To Turn ▸ TurnAttempt Turn0
Turn ▸ CycleAutomatic Rule Based on Sequence0.3
Turn ▸ StopThe character is no longer accelerating

It does not matter whether you drop in the left or the right quick-turn animation: the capsule is going to spin instantly, and the animation is what decides the direction visually.

Spinning the capsule without taking the body with it

This is the heart of the effect. In the Character Movement, set the Rotation Rate to -1: the capsule turns around instantly. Then, in the AnimGraph, add an Offset Root Bone node just before the Output Pose.

SettingValue
Translation ModeRelease
Translation Half Life0.05
Rotation Half Life0.1

This node offsets and rotates the character’s root bone independently of the capsule. The result: the capsule flips at once, but the character takes its time playing the pivot animation.

Disable the Offset Root Bone to compare: the character turns at the same time as the capsule, and the quick-turn animation simply stops reading. That node alone is what makes the effect legible.

A little inertia

  1. 1From the Character Movement, call Set Ground Friction.
  2. 2Feed it with a Select Float driven by Attempt Turn.
  3. 3During the turn: 3. The rest of the time: 8.

The character slides slightly as it commits to the pivot. It is a detail, but it is what gives the move weight — and it suits a slightly cartoon art direction particularly well.

If you later take your Animation Blueprint Thread Safe, this call will have to move into the character Blueprint: a Thread Safe function can read, never write.