A Unity project demonstrating a procedural IK system paired with a physically based water player controller. An otter character swims in a Crest ocean using rigidbody physics, with all limb motion driven by runtime IK — no baked animations.
Analytical 2-bone solver using law of cosines. Supports per-bone rotation constraints (euler limits or single-axis hinge), pole targets for bend direction, optional stretch, and smoothed blending.
A three-stage pipeline drives the front limbs:
- Lag points (
DynamicIndirectIk_V2) — inertial drag on each shoulder detects inner/outer side during turns - Trajectory frame (
IKStrokeTrajectory_V2) — parametric teardrop-ellipse evaluated in a dynamic basis derived from the lag point - Stroke controller (
IKStrokeController) — accumulates phase from body angular spin, samples the trajectory, and smooths the IK target in stable-basis-local space
- Trajectory (
HindPaddleTrajectoryRB) — parametric ellipse with tilt, turn-based yaw deviation, and demand-scaled amplitude - Driver (
HindPaddleDriverRB) — priority system merging movement kicks (from the swim rhythm machine) and per-leg idle turn kicks
Rigidbody swim controller integrated with Crest ocean sampling. Uses a time-domain rhythm machine (Prepare → Kick → Interval) that emits kick cycle events consumed by the limb drivers. Includes buoyancy, drag, torque-based alignment, and demand-based propulsion scaling.
SpineDecouplerWithShadows— runtime shadow nodes for independent spine joint manipulationHeadIKGuideFromArrowRB— positions a head look-target from the movement controller's aim direction
- Crest Ocean System — WebGPU-patched fork, consumed via git submodule
To update after changes in the fork:
# In the fork repo
./repo publish # re-runs subtree split and pushes both branches
# In this project
git submodule update --remote Assets/Crest