Skip to content

Inverse kinematics arm

capstone lesson Intermediate ⏱ 10 min vgai 0.1.0

Prerequisites: Manual — Animation (inverse kinematics)

What you'll learn

  • Run the IK example and watch the arm track a moving orb
  • Understand that the IKChain GameComponent bends a bone chain to an effector target
  • See that IK runs in preRender, after animation

What you'll build: An articulated arm whose tip tracks a moving target via CCD inverse kinematics.

Walkthrough — Inverse kinematics arm · generated by site/media/lessons/capstones-batch.lesson.ts (5 steps)

The ik example (packages/editor/template/src/examples/ik/) shows skeletal inverse kinematics: an articulated arm whose tip (effector) tracks a moving orb via the IKChain GameComponent, which wraps Three.js’s CCDIKSolver.

  1. Open the IK scene. Load examples/scenes/ik.vscn.json.

    The IK scene loaded
    The IK arm and target orb.
  2. Enter play mode. Press Play.

    The IK example running
    Play mode.
  3. Watch the arm track the moving orb. The orb moves; the arm’s tip follows it.

    The arm reaching toward the orb
    The effector tracks the target.
  4. The whole chain bends each frame to reach the target. Every bone in the chain rotates so the tip reaches the orb — that’s the inverse-kinematics solve.

    The full bone chain bent toward the target
    The whole chain solves each frame.
  5. Stop play mode. Press Stop (or Escape).

The IKChain component (phase preRender) wraps CCDIKSolver. It’s configured with the bone chain (root → effector), a target bone, and CCD iterations. Running in preRenderafter the animation phase — means IK refines whatever pose animation produced. IKChain is general: it works on any skinned mesh and any bone chain.

Recap

New functionality

  • Ran the IK example
  • Watched the arm track a moving target

New concepts & skills

  • IKChain bends a bone chain so its effector reaches a target
  • IK runs in preRender, after animation, to refine the pose
  • The component is general across rigs

Next lesson → Manual: Inverse kinematics