/godot-dev:godot-physicsfrom godot-dev
Diagnoses Godot physics bugs: signals that never fire, layer/mask misconfiguration, tunnelling, raycast misses, and body type issues in 2D and 3D.
Ships in godot-dev. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Most physics bugs are a layer, a mask or a monitoring flag, and a short probe shows which.
| Situation | Read |
|---|---|
"body_entered never fires", "the pickup does nothing", "the trigger works once" | Why a signal never fires below, then probe the scene |
| Layers and masks: who detects whom, layer numbers against bits, naming layers | reference/layers.md |
| A fast bullet or a falling crate goes through a wall or a trigger | Tunnelling below |
| A raycast that misses, hits the shooter, or hits a trigger | reference/queries.md |
| Rigid, character, animatable or static body; pushing crates; moving platforms; pinning a rigid body | reference/bodies.md |
| GodotPhysics3D or Jolt; tick rate; deterministic headless physics | The engine and the tick below |
| Tile collision | godot-tilemap |
Each cause holds in 2D and 3D (under both 3D engines); the selftest runs each beside its fix:
| Cause | Fix |
|---|---|
The area's monitoring is off | turn it on; an area that only needs to be found by others keeps it off and monitorable on |
| The area's own mask misses the body's layer (the body's mask holding the area's layer does not count) | put the body's layer in the area's collision_mask |
area_entered from an area whose monitorable is off | monitorable on for the area being detected |
Waiting for body_entered from an area (or area_entered from a body) | bodies arrive on body_entered, areas on area_entered |
A RigidBody2D/RigidBody3D body_entered with contact_monitor off, or max_contacts_reported 0 | both: contact_monitor = true and max_contacts_reported ≥ 1 |
A CollisionShape2D/3D with disabled, or no shape | enable it, give it a shape |
| A body faster than the area is thick (12000 px/s through a 4 px area: the area never fires, CCD on the body or not) | sweep a ray from the last position to the new one with collide_with_areas (reference/queries.md) |
Setting monitoring inside its own body_entered: ERROR: Function blocked during in/out signal. Use set_deferred("monitoring", true/false). and the value does not change | set_deferred("monitoring", false) |
Adding an area or body from inside a collision signal: ERROR: Can't change this state while flushing queries. Use call_deferred() or set_deferred() ... | add_child.call_deferred(node) |
Reading get_overlapping_bodies() right after adding the area: empty | overlaps exist after the next physics tick; a body already inside gets body_entered then |
A CharacterBody2D waiting for its own collision signal | it has none: read get_slide_collision_count() after move_and_slide() |
python3 scripts/physics_probe.py /path/to/project res://levels/rooftop_route.tscn
python3 scripts/physics_probe.py /path/to/project res://gate_room.tscn --ticks 300 --pairs
It runs resources/collision_probe.gd against the scene headless (by absolute path: nothing is
written into the project) and prints one OBJECT line per collision object (layer, mask,
monitoring, contact settings, enabled shapes), PAIR a -> b for every pair where a's mask holds
a layer of b (one-way when only one side does), FIRED with how often each connected signal
fired in N ticks, and a FAIL line for each connected signal that cannot fire as set up:
monitoring-off, contact-monitor-off, no-shape, mask-empty, mask-direction,
not-monitorable. Any finding or engine error is exit 2. Scripts with class_name need the
project imported once first. The probe can also be copied into the project and run with
-s res://.../collision_probe.gd -- res://scene.tscn 120.
A finding the probe cannot make: a body that is spawned later. A NOTE says when an area's mask
matches nothing in the scene; run a journey that spawns it (godot-play-harness).
A body moves a whole tick's distance at once. A crate at 12000 px/s moves 200 px per tick at 60 ticks and passes a 4 px wall without touching it.
RigidBody2D.continuous_cd = CCD_MODE_CAST_RAY stops it at the wall every time.
CCD_MODE_CAST_SHAPE does not, for box, circle and capsule shapes at 3000 to 30000 px/s against
4 and 20 px static walls; use the ray mode, or check the shape mode against your own case.RigidBody3D.continuous_cd = true stops it, under GodotPhysics3D and Jolt. Under Jolt
without CCD the body reports body_entered and still ends up past the wall: judge
tunnelling by position, never by the signal.CharacterBody2D moved by move_and_slide() at the same 12000 px/s stops at the 4 px wall:
the motion is swept. Writing position directly skips that.A layer is what an object is; a mask is what it looks for. An area detects what its own
mask holds. A moving body reacts to what its own mask holds: when only A's mask holds B, A stops
and B does not move; when only B's mask holds A, A passes and B is pushed. A rigid body whose
mask lacks the floor falls through it whatever the floor's mask says. In scene text the values are
bits (collision_mask = 36 is layers 3 and 6); in code use set_collision_mask_value(3, true)
with the 1-based layer number. Name the layers in project.godot and keep a table:
reference/layers.md.
physics/3d/physics_engine is "DEFAULT", "GodotPhysics3D" or "Jolt Physics".
A project that never sets it runs exactly like GodotPhysics3D. Every case in this
skill's selftest behaves the same under both engines, but resting depths differ slightly (a box
rests 0.01 m lower under GodotPhysics3D). Set it explicitly, so CI and every machine run the
same engine.physics/common/physics_ticks_per_second (60). Physics code goes in
_physics_process; queries too, since a body moved by setting position is found at its old
place until the next tick.--fixed-fps 60. Without it a headless run renders frames as fast as it
can, physics ticks follow wall-clock time, and --quit-after (which counts frames) ends a
60-tick test after a handful of ticks, with exit 0 and no sentinel. With it, one frame is one
tick and every run gives the same numbers.godot-camera → reference/jitter.md.python3 scripts/physics_probe.py --selftest (needs GODOT_BIN) probes a rooftop scene with each
mis-set-up signal (5 findings) and the same scene corrected (0 findings, every signal fires once),
then runs each cause beside its fix in 2D and in 3D under both engines, tunnelling with and
without CCD, the one-way mask cases, pinning and pushing rigid bodies, the queries of
reference/queries.md, and monitoring changed or a collision object added inside a signal (the
engine error, then the deferred call).
project.godot (layer_names/2d_physics/layer_1 ...) and in the design notes.set_deferred and
call_deferred: monitoring, shapes, and adding collision objects all print an ERROR: there.godot-verify.godot-2d-controller · godot-3d-controllergodot-tilemapgodot-3d-controllergodot-cameragodot-play-harnessWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub tipoli5890/game-studio --plugin godot-dev28 skills in this plugin
/godot-2d-controllerMove a 2D character in Godot: CharacterBody2D jump, coyote time, jump buffer, slopes, one-way and moving platforms, top-down movement./godot-2d-renderingGodot 2D look: draw order, z_index and y-sort, CanvasLayer, 2D lights and shadows, canvas shaders, Parallax2D, pixel-perfect scaling./godot-2d-rigA layered 2D character into Godot: rig2d.json to Skeleton2D, Bone2D and weighted Polygon2D parts, cut-out animation, 2D IK./godot-2d-spritesSprite frames into Godot: frames.json to SpriteFrames, AnimatedSprite2D, sheet slicing, pivots, filtering and import for pixel art./godot-3d-controllerMove a 3D character in Godot: CharacterBody3D grounding, slopes and steps, third and first person, lane runner, click-to-move./godot-3d-modelsBring a glTF model into Godot: import settings, post-import script, materials, LODs, collision; audit it against a triangle and texture budget.