PixPoly

Tutorial 05

Lean mode: leaning into turns

4:44

Lean mode tilts the character when it turns. Two ways to set it up: with an additive Blend Space that we build together, or procedurally, directly on the skeleton’s bones.

Chapters

  1. 0:00Enabling Lean mode
  2. 0:16Creating the additive poses
  3. 0:59The 1D Blend Space
  4. 1:23In-game test
  5. 1:56Turn Rate For Max and Interp Speed
  6. 2:25Procedural mode
  7. 2:58Multiple bones and Weight
  8. 3:41Max Angle and Turn Dead Zone
  9. 4:26Lean based on speed

Lean makes the character lean left or right when it turns. You enable it with the plus button of the Sections tab. It can be set up in two ways: with a Blend Space, or procedurally.

Creating the additive poses

Blend Space mode expects an additive Blend Space. The video builds one from scratch:

  1. 1Duplicate a base pose and make the copy additive: Additive Anim Type set to Local Space, Base Pose Type set to Selected Animation Frame, with the base pose as reference.
  2. 2Duplicate this additive pose to create the left pose: rotate spine_01 so the character looks left while leaning slightly, then add a key.
  3. 3Duplicate this clip for the right pose, delete the key and do the same on the other side.

Take the time to polish your poses: that is what the quality of the result depends on.

The 1D Blend Space

A 1D Blend Space is enough, since only left and right are set. The axis is called LR, from -1 to 1, with Snap to Grid. The base pose goes in the middle, the left and right poses on either side, and a Weight Speed of 5 smooths the interpolation.

In the Data Asset, place this Blend Space in the Blend Space slot. Mind the direction: if the character leans the wrong way, swap the poses.

In-game test

The character does take the Blend Space poses. Lean is played according to speed: weaker when walking, much stronger when running.

Turn Rate For Max and Interp Speed

  • Turn Rate For Max: the turn rate that produces the maximum tilt. Beyond it, the tilt is capped.
  • Interp Speed: how fast it interpolates towards the pose. At 1, the character takes a long time to reach the pose and come back; 5 works very well.

Procedural mode

Just select Procedural. Without setting anything, the character already leans: when no bone is defined, Lean is applied on spine_01.

Once a bone is chosen, you can change its rotation axis. On Z, the character twists sideways instead of leaning, and the Lean becomes more interesting.

Multiple bones and Weight

You can add as many bones as needed, and adjust each one with its Weight. In the video: the pelvis at 0.1, spine_01 at 0.4, and neck_01 with a Z axis so the character turns its head towards the turn.

Max Angle and Turn Dead Zone

  • Max Angle: the maximum tilt, in degrees, up to 90.
  • Turn Rate For Max: as in Blend Space mode.
  • Turn Dead Zone: as long as the rotation stays below this threshold, the character does not lean. At 1, it reacts instantly; at 20, no longer right away. This avoids a jerky effect when quickly alternating directions. The video uses 12.

Lean based on speed

Lean adapts to speed: the character leans less when walking, a little more when running.

All tutorials