Builtin Library
README.md
IKRig
Whole-character IK on a humanoid: both legs, both arms, a look-at, and ground adaptation, resolved through the body's canonical roles so one configuration works on any humanoid mesh.
hero.component.add("IKRig", { grounding = true, rightHandTarget = ledgeRef, lookTarget = playerRef })
Everything registers on a single solve pass in a fixed order: grounding, then legs, then spine and head, then arms. Grounding leads because it moves the pelvis, and the pelvis is the root of every limb.
Fields
leftFootTarget,rightFootTarget,leftHandTarget,rightHandTarget, each with a matching…Weight.lookTarget,lookWeight,lookClampAngle,lookBodyWeight.grounding— casts a ray under each foot, moves that foot's target to the surface, tilts it to the normal, and drops the pelvis far enough that neither leg over-reaches.groundingMaxSlope— how far a foot may tilt onto a steep face, in degrees.groundingFootHeight— how far the foot's origin sits above its sole.groundingHalfLife— smoothing on every value that comes off a raycast. Without it a ray crossing a step edge pops the foot between two heights.groundingRayUp,groundingRayDown— how far above and below the foot to cast.
An explicit foot target wins over the grounder. The grounder still counts that foot toward the pelvis drop, so planting one foot on a ledge while the other follows the terrain stays coherent.
Checking it
hero.component.get("IKRig"):rigState()
-- { ready, status, pelvisOffset, limbs, look, error }
limbs carries each resolved limb's weight, residual distance, ground contact
and lift. pelvisOffset is the current drop — roughly zero on flat ground
whether or not grounding is doing anything, so read the per-foot grounded
flags rather than the offset alone.
Climbing is a character controller's job. Grounding lowers the pelvis but never raises it, so a tall step asks a leg to stretch past its limit and the solve stops short.