Skip to content

77 game-dev skills for AI coding agents — Godot, Unity, Unreal, Phaser, PixiJS, three.js, Bevy, pygame, LÖVE, Roblox. Portable SKILL.md Agent Skills (the format Anthropic launched as Claude Skills), with a router that loads the right skill for your engine and task. Runs in Claude Code, Cursor, Kiro, Codex, Copilot, Gemini CLI and more.

fix(physics-tuning): Unity 6 damping/CCD names, Jolt solver settings, interpolation resets

Kiro Crewdc644267e605
diff --git a/skills/disciplines/physics-tuning/SKILL.md b/skills/disciplines/physics-tuning/SKILL.md
index a8cb118..6ceba61 100644
--- a/skills/disciplines/physics-tuning/SKILL.md
+++ b/skills/disciplines/physics-tuning/SKILL.md
@@ -71,15 +71,18 @@ func _process(_frame_dt): # Unity: void Update()
# then depend on frame rate and jitter under load.
```
-Most engines offer this for you (Godot `physics_interpolation`/Rigidbody
-interpolate; Unity `Rigidbody.interpolation = Interpolate`). Prefer the built-in
-before hand-rolling.
+Most engines offer this for you: Godot's project setting
+`physics/common/physics_interpolation` (off by default; it interpolates every
+node, 2D and 3D) and Unity's `Rigidbody.interpolation = Interpolate`. Prefer the
+built-in before hand-rolling, and never do both on the same node.
### 2. Stop tunneling: CCD + a speed cap
```gdscript
# Fast, small bodies skip past thin colliders between ticks. Two fixes:
-body.continuous_cd = true # RigidBody3D bool (RigidBody2D: CCD_MODE_* enum). Unity: rb.collisionDetectionMode = Continuous
+body.continuous_cd = true # RigidBody3D bool (RigidBody2D: CCD_MODE_* enum)
+# Unity: rb.collisionDetectionMode = CollisionDetectionMode.ContinuousSpeculative (cheap, covers
+# dynamic bodies too) or ContinuousDynamic (fast vs fast); plain Continuous sweeps vs static only.
# Cap velocity so a single step can't move more than ~one collider thickness.
const MAX_SPEED := 40.0
if velocity.length() > MAX_SPEED:
@@ -94,11 +97,12 @@ if velocity.length() > MAX_SPEED:
# Mass is RELATIVE weight in collisions; it does NOT change fall speed (gravity
# accelerates all masses equally). Use drag and gravity_scale to shape feel.
body.mass = 2.0 # heavier pushes lighter in collisions
-body.linear_damp = 0.5 # air drag: higher = stops sooner (Unity: drag)
-body.gravity_scale = 1.5 # per-object gravity multiplier (snappier fall)
+body.linear_damp = 0.5 # air drag: higher = stops sooner (Unity 6: linearDamping, was drag)
+body.gravity_scale = 1.5 # per-object gravity multiplier (Unity: Rigidbody2D.gravityScale)
# Bounce/slide come from the physics material, not code:
-material.bounce = 0.2 # restitution 0..1 (Unity: bounciness)
+material.bounce = 0.2 # restitution 0..1 (Unity: PhysicsMaterial.bounciness)
material.friction = 0.8 # surface grip
+body.physics_material_override = material
```
### 4. Collision layers and masks (who collides with whom)
@@ -133,7 +137,15 @@ pickup.collision_mask = LAYER_PLAYER # pickup only reacts to p
- **One-directional layer setup**: A's mask includes B but B's mask excludes A.
Detection/collision can need both sides; verify the full matrix.
- **Huge `dt` spikes** (load hitches, breakpoints) blow up integration. Clamp the
- max physics step / substep count so a stall doesn't launch everything.
+ max physics step / substep count so a stall doesn't launch everything (Godot
+ `physics/common/max_physics_steps_per_frame`, Unity *Maximum Allowed Timestep*).
+- **Teleports smear across the screen** with interpolation on: the renderer
+ blends from the old position. Godot: call `reset_physics_interpolation()`
+ *after* moving the node. Unity: move interpolated bodies through the
+ Rigidbody; a direct `transform` write is ignored unless followed by
+ `Physics.SyncTransforms()`.
+- **Feel changes after raising the physics rate**: Godot's damping is tick-rate
+ dependent, so changing `physics_ticks_per_second` needs damping re-tuned.
## References
diff --git a/skills/disciplines/physics-tuning/references/timestep-and-ccd.md b/skills/disciplines/physics-tuning/references/timestep-and-ccd.md
index 643cad4..b689f43 100644
--- a/skills/disciplines/physics-tuning/references/timestep-and-ccd.md
+++ b/skills/disciplines/physics-tuning/references/timestep-and-ccd.md
@@ -37,6 +37,11 @@ def frame(render_dt):
- Running 0, 1, or several physics steps per frame is normal and correct.
- Clamping `render_dt` (and `MAX_STEPS`) prevents a slow frame from requesting
dozens of steps, which would make the game slower still — the "spiral of death".
+- The price of the clamp: when rendering falls below `PHYSICS_HZ / MAX_STEPS`
+ FPS, the game runs in slow motion. Godot's equivalent is
+ `physics/common/max_physics_steps_per_frame` (default 8; raise it if you raise
+ the tick rate a lot); Unity's is *Maximum Allowed Timestep*, which bounds
+ `FixedUpdate` calls per frame to `maximumDeltaTime / fixedDeltaTime`.
## Render interpolation
@@ -51,8 +56,11 @@ visual_rot = slerp(prev_rot, curr_rot, alpha) # rotations: spherical lerp
This adds up to one physics step of latency but removes stutter. Engines expose
it directly: Unity `Rigidbody.interpolation = Interpolate` (or `Extrapolate`),
-Godot physics interpolation / `get_physics_interpolation_fraction()`. Prefer the
-built-in; hand-roll only for objects the engine doesn't cover.
+Godot `physics/common/physics_interpolation` / `get_physics_interpolation_fraction()`.
+Prefer the built-in; hand-roll only for objects the engine doesn't cover. After a
+teleport, reset the history (Godot `reset_physics_interpolation()` after the move;
+in a hand-rolled version set `prev_state = curr_state`) or the object visibly
+slides from its old position.
## Substepping
@@ -70,9 +78,14 @@ sweeps the body along its motion and catches the first contact.
- Enable CCD only on bodies that need it (small + fast: bullets, balls); it costs
more than discrete checks.
- Modes vary: sweep against static geometry only, or against dynamic bodies too
- (more expensive). Use the cheapest mode that fixes your case.
+ (more expensive). Use the cheapest mode that fixes your case. Unity names them
+ `Continuous` (static geometry only), `ContinuousDynamic` (static and dynamic)
+ and `ContinuousSpeculative` (static and dynamic, cheaper, but can cause "ghost
+ collisions" where a speculative contact deflects a body that would not have hit).
- Complementary fixes: cap maximum velocity so
`speed / PHYSICS_HZ < thinnest_collider`; thicken thin walls; raise PHYSICS_HZ.
+ For bullets, a ray or shape cast along the frame's motion is often simpler
+ than a fast rigid body.
## Solver iterations and stability
@@ -80,6 +93,12 @@ The constraint solver runs a fixed number of iterations per step; more iteration
= stiffer, more stable stacks and joints, at CPU cost.
- **Exploding/penetrating stacks**: raise solver (position/velocity) iterations.
+ Where the knob lives: Unity `Physics.defaultSolverIterations` (default 6) and
+ `defaultSolverVelocityIterations` (default 1), or per body. Godot 4.6+ creates
+ new projects on **Jolt Physics** (`physics/3d/physics_engine`); with Jolt use
+ `physics/jolt_physics_3d/simulation/velocity_steps` (default 10, keep ≥ 2 or
+ friction stops working) and `position_steps` (default 2) —
+ `physics/3d/solver/solver_iterations` only affects GodotPhysics3D.
- **Extreme mass ratios** (a feather resting under a boulder) are inherently
unstable — keep ratios within ~1:10 where you can.
- **Jittery resting contacts**: enable a small contact offset / allowed