PixPoly
All videos

Jump animations in Unreal Engine 5: take-off, apex, fall and landing

8:57

A single jump clip rarely does the job. Here is how to build an In Air State Machine that picks the animation depending on whether the character is running or not, chains the apex and the fall, and resumes the run without going back through the start.

Chapters

  1. 00:00Introduction
  2. 00:40Creating the In_Air State Machine
  3. 01:20Adding the jump animations
  4. 03:09Creating and wiring the transition variables
  5. 05:58Updating the transition variables

Most tutorials wire in one jump animation and stop there. The character takes off the same way whether he is standing still or in full stride, and lands with no transition. Here we trigger different animations depending on speed at take-off, add the apex and the fall, and handle picking the run back up on landing.

Everything happens in a dedicated State Machine. So it does not matter how your ground locomotion is built: the method applies as is.

Caching the ground locomotion

The ground State Machine — call it Ground Locomotion — is no longer wired directly into the rest of the graph. In its place you create a State Machine named In Air, and that is what connects to the Offset Root Bone, then to the Output Pose.

For the ground locomotion to stay callable from In Air, it has to be cached: New Saved Cached Pose, named for instance Cached Ground Locomotion.

  1. 1Create the In Air State Machine and wire it in place of the ground locomotion.
  2. 2Put the ground locomotion into a Saved Cached Pose.
  3. 3Inside In Air, create a Locomotion Ground state that does nothing but call that cache.

That state becomes the entry and exit point of the whole airborne system: you leave it to jump, you come back to it after landing.

The six animations, and the two aliases

StateWhen it plays
Jump IdleJump triggered while standing still.
Jump RunJump triggered during a run.
ApexTop of the jump — this is what gives the move its style.
FallingFalling, after the apex or after a step into thin air.
Land IdleLanding on the spot.
Land RunLanding at full speed.

Rather than dragging a transition from every state to every other, we use two Alias States: To Jump and To Land. An alias gathers several source states into one point, and the State Machine stays readable.

  • To Jump comes from Locomotion Ground, but also from Land Idle and Land Run — so you can jump again the instant you land.
  • To Land comes from Falling, and also from Apex — in case the character jumps onto a platform higher than himself.

To Jump also has to lead straight to Falling. Without that link, a character who walks off a ledge — without pressing jump — has no animation to play.

Four booleans to drive the transitions

  • Is Jumping — the character is going up.
  • Is Falling — the character is going down.
  • Is In Air — true until he touches the ground, jump and fall alike.
  • Is Acceleration — true while he is moving.

These variables are updated in the Event Graph, after the cast to the character. Is In Air reads directly: the Is Falling function of Character Movement returns true as long as the character is airborne, whichever way he is going.

The other two come from velocity. Right-click the Get Velocity output, Split Struct Pin, and you get the Z axis alone — the vertical one.

Velocity ZMeaningNode
Above 0The character is risingGreater → Is Jumping
Below 0The character is fallingLess → Is Falling
Equal to 0The character is grounded

Is Acceleration, finally, comes from Get Current Acceleration passed through Vector Length XY and compared to zero.

Wiring the transitions

  1. 1To Jump ▸ Jump Idle: Is Jumping true AND Is Acceleration false (a Not node between the two). Duration 0.1 — take-off has to be immediate.
  2. 2To Jump ▸ Jump Run: the same code, without the Not. Duration 0.1 as well.
  3. 3Jump Idle and Jump Run ▸ Apex: tick Automatic Rule Based on Sequence Player, the transition happens at the end of the clip.
  4. 4Apex ▸ Falling: Is Falling. A duration of 0.3 softens the change.
  5. 5To Jump ▸ Falling: the same rule, for the step into thin air.
  6. 6To Land ▸ Land Idle: Is In Air false AND Is Acceleration false.
  7. 7To Land ▸ Land Run: the same, without the Not on Is Acceleration.
  8. 8Land Idle and Land Run ▸ Locomotion Ground: Automatic Rule Based on Sequence.

Add a manual transition from Land Idle to Locomotion Ground as well: if the player takes off running before the landing finishes, the character responds immediately instead of playing his animation out.

The running-landing bug

Try a jump at full speed: on the way down, the character replays his start animation. It is visible, and it breaks the flow.

The reason shows if you watch the ground State Machine live: on the way back it passes through Start before reaching Cycle. But the character is already running — it should go straight into Cycle.

  1. 1In the Event Graph, create a Speed variable, of type float.
  2. 2Feed it with Get Velocity from Character Movement, passed through Vector Length XY.
  3. 3In the ground locomotion, drag a direct transition from Idle to Cycle.
  4. 4Condition: Speed greater than 50.

A character landing at speed picks his cycle back up without going through the start. And one who walks off a ledge drops straight into Falling, with no stray jump animation.