vedaloivdocs

Guide

Body IK

Documentation for v1.6.0Procedural IKFoot planting

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
  1. The components at a glance
  2. Head and spine
  3. Hands and holding items
  4. Foot planting
  5. Set it up
  6. Basic settings
  7. Advanced settings
  8. Finger grips
  9. Footsteps
  10. Common pitfalls

The components at a glance#

ComponentOnJobExecution order
PlayerFootPlantingmodelAnchors the feet to the ground and re-steps them−200
PlayerHeadIKmodelHead look-at10
PlayerSpineStabilizermodelKeeps the upper body steady while you look around15
PlayerHandIKmodelHands and elbows for held items, including the holster20
HandPoseControllermodelFinger grips on held items100
PlayerFootstepsrootFootstep 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.

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:

weight float default 1
Overall strength. SetWeight and SetWeightSmooth change it at runtime.
bodyWeight, headWeight, eyesWeight default 0, 1, 0
Share of the look that the body, head and eyes take. SetWeights sets all of them and the clamp together.
clampWeight float 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:

enableSpineStabilization bool default true
Turns the stabilizer on or off.
spineStiffness float default 1
Strength of the correction. 0 switches it off.
spineDamping float default 10
Smoothing speed of the correction.
lowerSpineWeight, middleSpineWeight, upperSpineWeight default 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, handVerticalLimitLower float 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#

  1. Check that PlayerFootPlanting is on the model. The Setup Wizard adds it in step 4.
  2. Make sure Ground Layers includes the floor. The default is the Default layer only.
  3. 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:

enablePlanting Enable Foot Planting, default on
Turns the whole system on or off. PlayerController.SetFootIKEnabled does the same at runtime.
plantMode PlantMode default Automatic
Idle and Moving fix the planting mode. Automatic (default) switches between them with the locomotion state, using idle hysteresis.
groundLayers LayerMask default Default layer
The layers the feet stand on.
stepSettings.stepDuration Step Duration, default 0.375
Seconds per re-step.
stepSettings.minLiftHeight, maxLiftHeight Min / 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) and probeLength (default 1).
  • Pelvis: pelvisFollowWeight (1), pelvisDropWeight (0.5) and pelvisRaiseLimit (0).
  • Re-Steps: the StepSettings curves for path, arc, lift and rotation, plus arcStrength (0.3), catchUpBoost (0.4) and restepDistance (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.

  1. Create a template with Create › Player › Finger Grip Pose. Set the five finger curls (0 open, 1 closed), thumbOpposition (wrap of the thumb) and spread.
  2. Select the item's ItemHoldData and open Finger Grip. Assign the right-hand template. For two-handed items, assign the left-hand template as well.
  3. 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.
  4. 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.

  1. Add PlayerFootsteps to the player root.
  2. Assign Step Clips (stepClips). One clip is picked at random for each step.
  3. Optional: assign Re-Step Clips (reStepClips) for steps taken while turning in place. Leave it empty to use the step clips.
stepVolume default 0.6 · reStepVolume default 0.3
Volume of walking steps and of re-steps.
pitchRange default 0.92 to 1.08
Random pitch per step.
minRootSpeed default 0.3 m/s
Slower movement stays silent. Steps are silent while airborne or standing still.
minIntervalPerFoot, minIntervalGlobal default 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.

Common pitfalls#