Skip to content

IK / 脚步修正

IK/脚步修正 ≠ RootMotion

  • RootMotion:由动画驱动实体位移(服务端权威)
  • 脚步修正:让脚更稳、更贴地,减少滑步和穿插

当前版本只提供轻量 2D 脚步 IK(默认开启),不做手部 IK。

1. 最小配置

bindings 中写:

yml
vars:
  ik:
    enabled: true
    leftFoot: "foot_l"
    rightFoot: "foot_r"
flags:
  footIk: true

如果模型骨骼名不同,请填真实名称。

2. 常用参数说明

  • enabled:是否启用
  • groundedOnly:仅在地面启用
  • leftFoot / rightFoot:脚骨骼名
  • rootBones:需要整体抬起/下沉的根骨骼
  • contactHeight:脚底接触高度(模型单位)
  • contactThreshold:触地权重阈值
  • lockStrength / lockFadeIn / lockFadeOut:脚锁定强度与淡入淡出
  • twoBoneIk:启用轻量 2D IK
  • twoBoneIkWeight:IK 权重

3. LOD / 性能

yml
vars:
  ik:
    lod:
      near: 32
      mid: 64
      far: 96
  • 近距离:全量
  • 远距离:简化或不执行

4. 速度同步(跑步不滑步)

yml
vars:
  ik:
    speedSync:
      enabled: true
      target: 4.3
      min: 0.6
      max: 1.4
      layer: "base"
  • target:目标速度(方块/秒)
  • min/max:缩放范围
  • layer:用于计算的动画层

5. 完整示例(RPG 人形)

yml
vars:
  ik:
    enabled: true
    groundedOnly: true
    rootBones: ["root", "hips"]
    leftFoot: "foot_l"
    rightFoot: "foot_r"
    contactHeight: 1.2
    contactThreshold: 0.25
    lockStrength: 1.0
    lockFadeIn: 0.12
    lockFadeOut: 0.18
    twoBoneIk: true
    twoBoneIkWeight: 1.0
    lod:
      near: 32
      mid: 64
      far: 96
    speedSync:
      enabled: true
      target: 4.3
      min: 0.6
      max: 1.4
      layer: "base"

6. 常见问题

  • 脚不动:脚骨骼名不匹配或 footIk 未开启。
  • 脚抖动:提高 lockFadeIn/lockFadeOut,或降低 lockStrength
  • 脚悬空/穿地:调整 contactHeight / groundOffset