Baked Hair Physics for Game Characters

Give a character's hair its own bones, simulate the swing through every animation clip, and bake it in so the game engine needs no physics setup.

A ponytail that stays rigid while the character jogs gives the game away immediately. The usual fix is a spring bone or physics setup in the engine, which then has to be tuned per engine and costs time every frame. The alternative is to simulate the hair once, offline, and bake the swing into the clips. This page does that with two nodes in Forge. It is one card in Free Auto Rig for Game Characters and comes after adding the animation clips.

The Hair Guides node selected in Forge: cyan joint chains drawn through each clump of the sample character's hair, with one Hangs from row per guide set to Auto (Head)

Step one: give the hair bones

After Auto Rig, the hair is weighted to the head and moves as one stiff piece with it. Hair Guides adds a chain of joints inside each clump you mark.

  1. Wire a Curve node into Hair Guides’ Guides input.
  2. Display Hair Guides, select the Curve, and draw one contour per clump of hair: a ponytail, a spike, the bangs. Start each contour at the root, where the hair leaves the scalp. The surface snap lands the points on the hair.
  3. Leave Center in volume on. It moves each guide into the middle of its clump, stopping short of the skull.

Each guide becomes Joints per guide joints (five by default), named Hair_01_1, Hair_01_2 and so on, hung from the bone nearest the root, usually the head. The hair around each chain is re-weighted to it by the same bone heat Auto Rig uses, so the face, brows and ears beside it keep their original weights.

While the Curve is selected, the viewport draws every chain over the character and paints red on any stretch that runs outside the mesh, so you can drag a point until the red disappears. Draw guides through clumps that stand clear of the face: a lock fused flat against a cheek cannot be told apart from the cheek.

Step two: simulate and bake

Add Hair Physics after Hair Guides and after the last Add Animation. For every clip on the rig it plays the clip on the body and treats each hair chain like a string of weights on springs: the root follows its bone, the rest is pulled back towards the drawn shape, drops under gravity when the head tilts, and trails behind fast movement. Every joint is pushed out of the body, so long hair rests on the back instead of sinking through it.

The result is written into that clip as rotation keys on every hair joint. The body’s keys are untouched. Because the motion is part of the clips, the exported file plays the swinging hair in any engine with no physics setup at all.

Each clip is played several times before recording so the hair has settled, and the end of the recording is blended into its start, so the loop plays without a jump.

Tuning the swing

  • Stiffness: how hard the hair springs back to its drawn shape. Lower swings more.
  • Stiffness along hair: a curve from root to tip. The default keeps roots firm and lets tips move.
  • Weight: heavier hair drops further when the head tilts and lags further behind.
  • Damping: how quickly a swing dies out. The default, 0.6, settles a jog’s bounce within a stride or two.
  • Gravity: pulls the hair down only as far as the head tilts from its rest pose, so spikes stay up. Set it to 0 for hair that only reacts to movement.
  • Travel speed: the bundled clips play in place, so on its own the hair would never stream back. Each clip gets a speed (Walk 1.4 m/s and Jog 3 m/s by default) that blows the hair back like a headwind.

Short spikes and long locks want different settings, so Per guide lets each chain override Weight, Stiffness, Damping and Gravity. For stiff spikes, raise a guide’s Stiffness and Damping to about 0.9.

Collisions and their limits

The body the hair collides with is a sphere for the head and capsules along the neck, spine, shoulders and upper arms, each fitted to the character. Turn on Show colliders to see them. Raise Collision margin when the hair is thick or rests on clothing. Legs, forearms and hands do not collide, and hair does not collide with itself, so very long hair swinging past the hips can still pass through the legs.

One ordering rule: Hair Physics bakes only the clips that exist when it cooks. A clip added after it has no hair keys, so keep Hair Physics after the last Add Animation.

The character is now rigged, animated and has moving hair. The last step is getting it into Unreal Engine.

Frequently asked questions

Do I need a physics or spring bone setup in my engine?
No. The swing is written into each animation clip as rotation keys on the hair joints, so Unreal, Unity, Godot and Blender play it like any other animation. Nothing runs at runtime.
How do I mark which parts of the mesh are hair?
Draw a Curve through each clump of hair, one contour per clump, starting at the root where the hair leaves the scalp. Hair Guides turns each contour into a chain of joints hung from the nearest bone, usually the head, and weights the hair around it to that chain.
Why does the hair go through the body?
The body the hair collides with is a sphere for the head and capsules along the neck, spine, shoulders and upper arms. Legs, forearms and hands do not collide. Raise Collision margin for thick hair or hair resting on clothing, and turn on Show colliders to see where the colliders are.
Will the baked clips loop without a pop?
Yes. Hair Physics plays each clip several times before recording so the hair settles, then blends the end of the recording into its start, so the last key matches the first.