gamedev-skills/awesome-gamedev-agent-skills/physics-tuning
Claude Code and agent skill by gamedev-skills/awesome-gamedev-agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Engine-neutral physics tuning with Godot checks: fixed timestep and interpolation, CCD against tunnelling, damping, solver iterations and collision layer matrices. Use when bodies jitter, fast objects pass through walls or physics feels floaty or wrong. Not for engine physics APIs (`godot-physics`, `unity-physics`, `roblox-physics`, `phaser-arcade-physics`) or jump feel (`platformer`).
Install
npx vskill@latest install gamedev-skills/awesome-gamedev-agent-skills/physics-tuningSKILL.md
The same SKILL.md was published earlier as gamedev-skills/awesome-gamedev-agent-skills/physics-tuning.
Physics tuning
Most "bad physics" is a mismatch between the fixed-rate simulation and the variable-rate render loop, or untuned CCD, mass, damping and layer settings. This skill owns those engine-neutral decisions and the checks that prove them. The engine's bodies, callbacks and settings come from godot-physics, unity-physics or roblox-physics; load both when tuning inside an engine.
When to use
- Motion jitters, bodies tunnel through walls, stacks explode, joints shake, or speed depends on
frame rate.
- Deciding what runs in the fixed step and what in the render frame, and how to interpolate.
- Tuning gravity, mass, damping, restitution, solver iterations, sleeping and the layer matrix.
Not this skill: engine API (godot-physics, unity-physics, roblox-physics), character controller code (godot-2d-movement), jump arcs and forgiveness windows (platformer), camera smoothing (camera-systems), CPU cost of the simulation (performance-optimization).
Core workflow
- Read the current settings first: tick rate, max steps per frame, interpolation, physics
engine (Godot [physics] in project.godot; Unity ProjectSettings/TimeManager.asset and DynamicsManager.asset). Change one knob at a time.
- Simulate in the fixed step. Forces, velocities and collision reads go in
_physics_process / FixedUpdate and use that step's dt.
- Interpolate rendering between ticks with the engine's built-in option before
hand-rolling it.
- Stop tunnelling: keep
speed / tick_ratebelow the thinnest wall, or enable CCD on the
small fast bodies, or use a ray or shape cast for bullets.
- Tune the body, not the scene: mass for relative weight, damping for drag, gravity scale
per object, bounce and friction in a physics material.
- Stabilize stacks and joints with modest mass ratios, more solver iterations and sleeping.
- Plan the layer matrix as a named table: what each layer is, and what it scans.
- Run the checks below, then ask the user to judge feel with specific questions.
Patterns
1. Fixed step for simulation, interpolation for display
Turn on the built-in interpolation: Godot physics/common/physics_interpolation = true (off by default; it covers 2D and 3D nodes), Unity Rigidbody.interpolation = Interpolate on the player and the bodies the camera follows. Hand-roll (Engine.get_physics_interpolation_fraction(), lerp previous to current) only for something the engine does not cover, and never both on one node.
2. Tunnelling: CCD and a speed cap
3. Body tuning
4. Collision layer matrix as data
Write the same table into the engine's layer names (Godot [layer_names] in project.godot; Unity's Physics collision matrix) so the editor and code agree.
5. Tunnel test (headless, exits 1 on failure)
Set the constants to the game's fastest body and thinnest wall. For 3D, use RigidBody3D with continuous_cd = true, BoxShape3D and SphereShape3D; that passed here on both GodotPhysics3D and Jolt.
6. Frame-rate independence probe
Movement done in the physics step prints the same position at both rates. A falling body moved in _process landed about 23 px apart after 2 s at 30 and 144 FPS in a test here, while the same code in _physics_process matched to the last digit. Any difference means simulation code is reading the frame dt.
Check it
- Run the tunnel test with the game's fastest body and thinnest wall; it must print
ok. - Run the rate probe at
--fixed-fps 30and--fixed-fps 144on the player or a thrown body;
the positions must match.
- Grep for forces,
velocitywrites andmove_and_slidein_process/Update; move them
to the fixed step.
- Ask the user to play at a capped low frame rate and at an uncapped high one (Godot
--max-fps 30, then --disable-vsync), throw the fastest object at the thinnest wall, stack ten crates and push them, and report any jitter, pass-through or explosion, and whether the motion feels floaty or heavy. Feel is their call; the numbers above are yours.
Gotchas
- Jitter even with a fixed step usually means no render interpolation: the physics and
display rates beat against each other.
- Godot 2D `CCD_MODE_CAST_SHAPE` did not stop tunnelling in a 4.7.2 GodotPhysics2D test: a
4 px circle at 600-6000 px/s crossed a 4 px wall exactly as with CCD off, while CCD_MODE_CAST_RAY stopped it every time. Use the ray mode and prove it with the tunnel test.
- Discrete collision pushes a body out the far side once its centre passes the middle of a
thin wall in one step, so it tunnels even at speeds where the shapes do overlap.
- Expecting heavier objects to fall faster. Gravity is an acceleration; mass changes
collision response. Shape feel with gravity scale and damping.
- Exploding stacks and jittery joints: extreme mass ratios (keep within about 1:10) or too
few solver iterations.
- Bodies that never sleep burn CPU and twitch. Enable sleeping and check the thresholds.
- One-sided layer setup: A scans B but B does not scan A. Check both directions of the
matrix.
- Huge `dt` after a hitch launches bodies. Clamp steps per frame (Godot
physics/common/max_physics_steps_per_frame, default 8; Unity Maximum Allowed Timestep). The price is slow motion below tick_rate / max_steps FPS.
- Teleports smear across the screen with interpolation on. Godot: call
reset_physics_interpolation() after moving the node. Unity: with interpolation on, the physics system owns the transform and ignores a direct transform write unless it is followed by Physics.SyncTransforms(); move the Rigidbody instead.
- Feel changes after raising the tick rate: Godot (GodotPhysics and Jolt alike) damps by
multiplying velocity by 1 - damp * step each tick, clamped at 0, so large damping values behave differently at another tick rate. Re-tune them after changing physics_ticks_per_second.
- Raising Godot `solver_iterations` with no effect: that setting only affects GodotPhysics3D.
Jolt uses its own velocity_steps and position_steps (see the reference).
References
references/timestep-and-ccd.md: read when you need the accumulator loop and the clamp
trade-off, interpolation maths and teleport resets, substepping, CCD modes per engine, solver iterations (including Jolt's settings), sleeping, or the stability checklist.
Related skills
godot-physics,unity-physics,roblox-physics: engine bodies, colliders and callbacks.platformer: jump arcs, coyote time and jump buffering on top of this tuning.camera-systems: following an interpolated body without jitter.performance-optimization: when the physics step itself is too slow.
Version notes
Last verified: 2026-11-11.
- Godot 4.7:
physics/common/physics_interpolation(default false),
max_physics_steps_per_frame (default 8), physics_ticks_per_second (default 60); damping is velocity *= max(1 - damp * step, 0) in both modules/jolt_physics/objects/jolt_body_3d.cpp and modules/godot_physics_3d/godot_body_3d.cpp at the 4.7-stable tag.
- The tunnel test, the CCD mode results and the rate probe were run on Godot 4.7.2 headless.
- Unity 6.3: interpolation takes control of the transform and needs
Physics.SyncTransforms
after a direct write (https://docs.unity.com/en-us/engine/6000.3/script-reference/unityengine/rigidbody/interpolation).
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/disciplines/physics-tuning/SKILL.md
Popularity
- Repository stars
- 8,880
- Repository forks
- 904
- 7-day trend score
- 35
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/gamedev-skills/awesome-gamedev-agent-skills/physics-tuning)