Guide
Body IK
Make the body believable in first person: the head looks where you look, the hands hold items, the feet stay on the ground and the fingers wrap around what you carry. This guide shows which component does each job and which settings you will change.
On this page
The components at a glance#
| Component | On | Job | Execution order |
|---|---|---|---|
PlayerFootPlanting | model | Anchors the feet to the ground and re-steps them | −200 |
PlayerHeadIK | model | Head look-at | 10 |
PlayerSpineStabilizer | model | Keeps the upper body steady while you look around | 15 |
PlayerHandIK | model | Hands and elbows for held items, including the holster | 20 |
HandPoseController | model | Finger grips on held items | 100 |
PlayerFootsteps | root | Footstep sounds and events | −300 |
The Setup Wizard adds the model components (except footsteps). The lower the order, the earlier the component runs, so the head is solved before the hands.
Head and spine#
PlayerHeadIK turns the head toward the look direction. Its weights decide how much of the look goes to the body, head, eyes, and how far the head may turn:
weightfloat default 1- Overall strength.
SetWeightandSetWeightSmoothchange it at runtime. bodyWeight,headWeight,eyesWeightdefault 0, 1, 0- Share of the look that the body, head and eyes take.
SetWeightssets all of them and the clamp together. clampWeightfloat default 0.5- How far the head may turn away from the body.
PlayerSpineStabilizer keeps the spine upright while the head moves. It is configured in PlayerSettings:
enableSpineStabilizationbool default true- Turns the stabilizer on or off.
spineStiffnessfloat default 1- Strength of the correction. 0 switches it off.
spineDampingfloat default 10- Smoothing speed of the correction.
lowerSpineWeight,middleSpineWeight,upperSpineWeightdefault 0.3, 0.3, 0.4- How much each spine segment takes part in the correction.
Hands and holding items#
The hands are driven by PlayerHandIK. Where an item sits in your hands comes from its ItemAttachmentData, described in Items: Grips and IK. Global limits come from PlayerSettings:
handVerticalLimitUpper,handVerticalLimitLowerfloat default 45 / 45- Degrees of look up and down before the hand stops following the view. Items can override them.
The holster timings (holsterDuration, drawDuration, drawStartWeight) are described in Items: Equip, switch, holster and use. Two-handed items fade the left hand on and off over twoHandedBlendDuration (default 0.2 seconds).
Foot planting#
PlayerFootPlanting keeps each foot anchored to the ground where it was set down. While you stand or turn in place, a foot that moves too far from its anchor takes a short curved re-step to a new anchor, instead of sliding. Feet also align to the ground height and slope, and the pelvis lowers so both feet reach uneven ground. The component uses its own leg solver and runs before the camera syncs to the head.
Set it up#
- Check that
PlayerFootPlantingis on the model. The Setup Wizard adds it in step 4. - Make sure Ground Layers includes the floor. The default is the Default layer only.
- Enter Play Mode and walk over an uneven surface or turn in place to test it.
Basic settings#
The Beginner view shows the settings most projects need:
enablePlantingEnable Foot Planting, default on- Turns the whole system on or off.
PlayerController.SetFootIKEnableddoes the same at runtime. plantModePlantMode default AutomaticIdleandMovingfix the planting mode.Automatic(default) switches between them with the locomotion state, using idle hysteresis.groundLayersLayerMask default Default layer- The layers the feet stand on.
stepSettings.stepDurationStep Duration, default 0.375- Seconds per re-step.
stepSettings.minLiftHeight,maxLiftHeightMin / Max Foot Lift, default 0.1 / 0.4- How high the foot lifts during a re-step.
Advanced settings#
Click Advanced Settings to show the foldouts:
- Planting:
anchorCaptureRange(default 0.375) is how far the animated foot may move from its anchor before it is released.releaseAngle(30 degrees) releases a planted foot that twists too far.maxLegExtension(0.99) pulls the anchor back when the leg is stretched too far. - Ground Align:
alignFeetToGround(on),maxFootYaw(30 degrees) and the speed of ground alignment. - Ground Probe:
groundLayers,triggerInteraction(ignores triggers by default) andprobeLength(default 1). - Pelvis:
pelvisFollowWeight(1),pelvisDropWeight(0.5) andpelvisRaiseLimit(0). - Re-Steps: the
StepSettingscurves for path, arc, lift and rotation, plusarcStrength(0.3),catchUpBoost(0.4) andrestepDistance(0.055).
Finger grips#
HandPoseController sets the fingers around the held item on top of the animation. It reads the finger limits from the Humanoid avatar, so it works on any humanoid rig with mapped finger bones. Press Calibrate in its Inspector after you change the avatar. Items without a grip keep the animated fingers.
A grip has two parts. A FingerPose asset is a reusable template. Per item, you add tweaks on top of the template.
- Create a template with . Set the five finger curls (0 open, 1 closed),
thumbOpposition(wrap of the thumb) andspread. - Select the item's
ItemHoldDataand open Finger Grip. Assign the right-hand template. For two-handed items, assign the left-hand template as well. - Adjust the item with the tweaks: Hand Tweak (whole hand), Index Tweak and Thumb Tweak. The tweaks stay on the item and never change the shared template. Reset Tweaks clears them.
- Click Open Preview to see the grip on the player in Edit Mode. Use Save As New Template… to keep a tweaked grip as a new template.
Grips follow the item that is visible. During a holster animation, the fingers change with the item.
Footsteps#
PlayerFootsteps plays a sound when a foot lands. It reads the animated feet, so no animation events are needed. Add it to the player root by hand, because the Setup Wizard does not add it.
- Add
PlayerFootstepsto the player root. - Assign Step Clips (
stepClips). One clip is picked at random for each step. - Optional: assign Re-Step Clips (
reStepClips) for steps taken while turning in place. Leave it empty to use the step clips.
stepVolumedefault 0.6 ·reStepVolumedefault 0.3- Volume of walking steps and of re-steps.
pitchRangedefault 0.92 to 1.08- Random pitch per step.
minRootSpeeddefault 0.3 m/s- Slower movement stays silent. Steps are silent while airborne or standing still.
minIntervalPerFoot,minIntervalGlobaldefault 0.2 s and 0.08 s- Minimum time between steps of one foot, and between any two steps.
Your own effects can listen to FootPlanted (C#, receives FootStepArgs) or to OnFootPlanted (UnityEvent). Both fire for walking steps and re-steps.