> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinemation.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Foot IK Modifier: Keep Feet Planted on Any Surface

> The Foot IK modifier in CAS uses raycasting to keep character feet planted on uneven geometry — preventing floating or clipping on slopes and steps.

The **Foot IK** modifier performs collision detection beneath each foot and adjusts the foot and pelvis positions so the character's feet conform to the surface below them. Without it, a character walking across a slope or climbing a step will appear to float above or clip through the geometry. Foot IK solves that by driving IK target bones to the surface contact point, leaving the Two Bone IK modifier to apply the final limb solve.

## Properties

<ParamField path="Layer Mask" type="LayerMask">
  The physics layers that the foot raycasts will test against. Include only the layers that represent walkable surfaces — terrain, floors, and ramps — and exclude dynamic objects like characters or props.
</ParamField>

<ParamField path="Pelvis" type="KRigElement">
  The pelvis or hip bone. Foot IK lowers the pelvis when one foot needs to reach down to a surface, keeping the character's body posture plausible.
</ParamField>

<ParamField path="Right Foot" type="KRigElement">
  The IK target bone for the right foot. This bone's position will be driven to the raycast hit point on the surface.
</ParamField>

<ParamField path="Left Foot" type="KRigElement">
  The IK target bone for the left foot. This bone's position will be driven to the raycast hit point on the surface.
</ParamField>

<ParamField path="Foot Height" type="float">
  The vertical height of the foot from its pivot point. Used to offset the final IK position so the sole of the foot rests flush on the surface rather than sinking through it.
</ParamField>

<ParamField path="Foot Radius" type="float">
  An approximate radius of the foot used for the collision shape. Increase this value for wider feet to get more stable contact detection on curved surfaces.
</ParamField>

<ParamField path="Ray Offset" type="float">
  A vertical offset applied to the raycast origin. Raising this value starts the ray higher above the foot, giving it more clearance to detect surfaces on steep steps.
</ParamField>

<ParamField path="Interp Speed" type="float">
  The smoothing speed used when interpolating the foot and pelvis toward their corrected positions. Set to `0` to disable smoothing entirely and apply corrections instantly.
</ParamField>

## Modifier Order

Foot IK is a **setup** modifier — it writes corrected positions into the IK target bones but does not apply limb rotation itself. You need Two Bone IK modifiers placed **after** Foot IK in the Procedural Animation Settings list to consume those target positions and solve the leg chains.

The recommended modifier stack order for a full foot-planting setup is:

1. **Copy Bone** — copy real foot pose to IK foot targets.
2. **Stride Modifier** *(optional)* — warp stride to match velocity and pin feet during contact.
3. **Step Modifier** *(optional)* — play procedural steps on state transitions.
4. **Foot IK** — raycast and drive IK targets to the surface.
5. **Two Bone IK (right leg)** — solve the right leg chain.
6. **Two Bone IK (left leg)** — solve the left leg chain.

<Note>
  Place Foot IK **before** your Two Bone IK modifiers in the list. Two Bone IK reads from the IK target positions that Foot IK has just written.
</Note>

## Use Cases

* **Locomotion on terrain** — prevent feet from floating above a slope or hillside when the character moves across uneven ground.
* **Stepping up or down** — keep feet planted on different-height steps without the whole character body shifting awkwardly.
* **Standing on angled surfaces** — rotate the foot to follow the surface normal so the sole conforms to ramps or rooftops.

<Tip>
  Set **Interp Speed** to `0` to disable smoothing and apply corrections instantly. For most characters a small positive value produces a more natural feel; increase it for snappier response and decrease it for a more gradual correction.
</Tip>
