Menu
Lumberyard
Legacy Reference

Foot IK and Ground Alignment

Lumberyard can automatically adjust a character's legs and feet to match the surface of the terrain the character is walking on. This adjustment includes foot alignment to the direction of the slope, in addition to adjusting the legs to different ground heights.

Leg and foot IK setup is defined in the character .chrparams file. Both legs must be added to the file as follows:

<LimbIK_Definition> <IK EndEffector="Right_Foot" Handle="RgtLeg01" Root="Right_Thigh" Solver="2BIK"/> <IK EndEffector="Left_Foot" Handle="LftLeg01" Root="Left_Thigh" Solver="2BIK"/> </LimbIK_Definition>

The Handle name for the right and left legs must be "RgtLeg01" and "LftLeg01" respectively, You can use any naming for the calf, foot, and thigh as long as they are defined in the .chrparams file. For more information, see Chrparams File Elements.

The bones listed following must be named as shown in the list and are required for ground alignment. The last four bones listed are all children of the foot bone.

  • Bip01 pelvis – The character's hip joint.

  • Bip01 planeWeightLeft – For 3ds Max, this bone shares the same x and y position but is approximately 100 cm. above the foot on the z-axis. For Maya, this bone shares the same x and z position but is approximately 100 cm. above the foot on the y-axis.

  • Bip01 planeTargetLeft – For 3ds Max, this bone shares the same x and y position and is aligned to 0 on the z-axis. For Maya, this bone shares the same x and z position and is aligned to 0 on the y-axis.

  • Bip01 planeWeightRight – For 3ds Max, this bone shares the same x and y position but is approximately 100 cm. above the foot on the z-axis. For Maya, this bone shares the same x and z position but is approximately 100 cm. above the foot on the y-axis.

  • Bip01 planeTargetRight – For 3ds Max, this bone shares the same x and y position and is aligned to 0 on the z-axis. For Maya, this bone shares the same x and z position and is aligned to 0 on the y-axis.

The PlaneTarget and PlaneWeight bones are set up to give an absolute offset limit. The aligned pose drives the PlaneTarget node to align to the PlaneWeight node and no further.

Debugging Ground Alignment Poses

You can use the following console variables for debugging:

  • a_poseAlignerEnable 1 – Enables alignment.

  • a_poseAlignerDebugDraw 1 – Enables debug drawing of plane weight, target, and root offsets.

  • a_poseAlignerForceWeightOne 1 – Forces the weight to 1, which causes the limb to automatically adjust.