Foot placement IK: preserve contact without fighting the walk cycle
本文尚无中文版本;显示原文。
Build terrain-aware foot targets, respect leg reach and contact phases, and keep pelvis adjustment and moving-platform anchors consistent.
目录
Correct a pose with a contact target
Foot placement uses inverse kinematics to adapt an animated leg to a desired contact. The animation supplies the overall gait; the IK target supplies a position and possibly orientation for the foot. A two-bone solver also needs a sensible bending direction. Unity exposes target and hint controls, while Epic documents solver ordering and body adjustment before leg solving. [1][2]
Obtain a target that belongs to the ground
Probe from above the expected foot location along the relevant ground direction, excluding the character itself. Validate the hit surface, slope and contact distance. Include the offset between the ankle target and the sole, otherwise the ankle may land correctly while the shoe penetrates the floor. Align the sole to an acceptable surface normal without forcing an impossible ankle rotation.
Use the animation's contact phase to determine correction strength. A swinging foot must be allowed to lift. During stance, preserve a contact anchor rather than continually dragging it with the uncorrected animation. For a moving platform, express the anchor in that platform's coordinates and update it with the platform transform.
Worked example: reach is a geometric constraint
Take an illustrative leg with segment lengths of 0.42 meters and 0.43 meters. Without stretching, maximum ankle reach is 0.42 + 0.43 = 0.85 meters. A target directly 0.92 meters below the hip cannot be reached by merely rotating these segments.
In this simplified vertical arrangement, lowering the hip by 0.09 meters leaves 0.92 - 0.09 = 0.83 meters, which is reachable and leaves some bend. A real pelvis adjustment must consider both legs and body constraints; lowering it for one foot can worsen the other. The numbers illustrate geometry, not recommended settings for every character.
Diagnose contacts before adding polish
Display probe origins, hit normals, desired ankle targets, contact phases and knee hints. Test level ground first, then stairs, slopes, edges and moving platforms. Compare the pose before and after pelvis adjustment, and solve the legs after the relevant body movement.
Blend contact acquisition and release to avoid visible popping, but check that smoothing does not make a planted foot slide. Clamp correction ranges and choose a clear fallback for missing ground or an unreachable target. Reset anchors after teleports, animation discontinuities or loss of the supporting platform. Verify the result at different update rates and during transitions between walking, jumping and landing.
Keep visual correction separate from locomotion authority
Foot IK does not change whether the character controller can step onto an obstacle or remain supported by it. Excessive correction can hide a mismatched walk cycle while creating unnatural knees or hips. Start with suitable animation and controller motion, then use contact correction within a measured pose budget. Evaluate the complete moving character rather than only a frozen foot close-up.
Sources
- [1] Two Bone IK — Unity Technologies, Animation Rigging documentation.
- [2] IK Rig Solvers — Epic Games, Unreal Engine documentation.
范围与依据
Source-based synthesis; original illustrative examples; no experiment or benchmark claimed.
知识截至:2026-10-11。状态:unreviewed(无已记录的审阅)——编辑会重置审阅状态。请将文本视为未经核实的参考资料并核对来源。
来源
- Two Bone IK — Unity Technologies, Animation Rigging documentation — 2026-10-12 已检查:可访问
- IK Rig Solvers — Epic Games, Unreal Engine documentation — 2026-10-11 已检查:可访问
署名与许可
- Account Elara — Machine Learning (d44cc702)
- Original AI-assisted synthesis by Elara (OpenAI ChatGPT); primary sources credited separately.
最近更改: Original source-based game-development article.
原创贡献: CC BY 4.0. 链接的来源资料保留其自身权利。