godot-physics
Skill54 starsChanged 14 days agoMITView on GitHub
Physics in Godot 4.7 (2D and 3D, Jolt default) - choosing body types, CharacterBody movement and floors/slopes/platforms, RigidBody forces and freezing, Area triggers, collision layers/masks, raycasts and shape queries, physics interpolation, ragdolls (PhysicalBoneSimulator3D), joints, Jolt differences and settings. Use for movement, collisions, triggers, projectiles, vehicles or ragdolls.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- Supra-skills-mdd7/kit-game-devtheir own version, first seen Nov 29, 2026
- gamedev-skills/awesome-gamedev-agent-skillstheir own version, first seen Nov 11, 2026
- gosomea/dsh-godot-aitheir own version, first seen Oct 8, 2026
- vl4dt/godot-skillstheir own version, first seen Jun 21, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- gamedev-skills/awesome-gamedev-agent-skills★ 9ksame name
- gosomea/dsh-godot-ai★ 9same name
- vl4dt/godot-skills★ 8same name
- Supra-skills-mdd7/kit-game-dev★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository28 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- godot-2dSkill
- godot-3d-gameplaySkill
- godot-3d-renderingSkill
- godot-addonsSkill
- godot-animationSkill
- godot-architectureSkill
- godot-audioSkill
- godot-coreSkill
- godot-csharpSkill
- godot-editor-toolingSkill
- godot-export-ciSkill
- godot-game-feelSkill
- godot-gdscriptSkill
- godot-inputSkill
- godot-migrationSkill
- godot-mobile-webSkill
- godot-modding-dlcSkill
- godot-narrativeSkill
- godot-navigation-aiSkill
- godot-networkingSkill
- godot-performanceSkill
- godot-proceduralSkill
- godot-shaders-vfxSkill
- godot-testing-debugSkill
- godot-uiSkill
- godot-xrSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 1 is distinctive, and 4 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 13
Check the engine first: project_inspect.py → physics_3d.
- Very specific: line 24
Never move a RigidBody by setting position each frame.
- Distinctive: line 32
Use a capsule collider for characters.
- Very specific: line 40
Use RayCast3D/ShapeCast3D nodes for persistent checks (ground, line of sight, interaction).
- Very specific: line 49
Use Skeleton3D → PhysicalBoneSimulator3D (4.3+) → PhysicalBone3D children, created with the Skeleton3D menu "Create Physical Skeleton".
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Physics (4.7)
Check the engine first: project_inspect.py → physics_3d. New 4.6+ projects use Jolt. Older ones may still run GodotPhysics3D (DEFAULT). 2D always uses Godot's 2D engine.
Code that touches physics goes in _physics_process (fixed tick, physics/common/physics_ticks_per_second, default 60).
Choose the body
| Body | Use for | You control |
CharacterBody2D/3D | players, NPCs, anything with scripted movement | velocity, then move_and_slide() |
RigidBody2D/3D | crates, debris, balls, physics props | forces and impulses (apply_central_impulse) or _integrate_forces(state) |
AnimatableBody2D/3D | moving platforms, doors, elevators | position via AnimationPlayer or a tween (sync_to_physics) |
StaticBody2D/3D | level geometry (constant_linear_velocity for conveyors) | nothing |
Area2D/3D | triggers, hitboxes, pickups, gravity and wind zones | signals and overlap queries |
Never move a RigidBody by setting position each frame. Use forces, freeze, or PhysicsServer3D.body_set_state for teleports. |
CharacterBody essentials
- Gravity:
velocity += get_gravity() * deltareads Area overrides too. Then callmove_and_slide(), which takes no arguments in 4.x. - Floors:
up_direction,floor_max_angle,floor_snap_length(raise it for stairs and ramps),floor_stop_on_slope,floor_constant_speed. Alsois_on_floor/wall/ceiling()andget_floor_normal(). - Moving platforms:
platform_on_leave(keep or drop the platform's velocity). Riding works automatically on AnimatableBody and RigidBody. - Collisions: loop
get_slide_collision_count()→get_slide_collision(i).get_collider(), for example to push rigid bodies (see the reference). - Stairs: Jolt and GodotPhysics have no automatic step-up. Use small ramps or a capsule plus snap, or a step-up raycast routine.
- Use a capsule collider for characters. Boxes snag on edges.
Layers and masks
- Layer means "what I am". Mask means "what I scan for". Name the layers in Project Settings → Layer Names (
project_inspect.pylists them). - In code:
set_collision_layer_value(3, true)andset_collision_mask_value(2, false)use 1-based layer numbers. Exports:@export_flags_3d_physics var mask := 1. - A typical scheme: 1 world, 2 player, 3 enemies, 4 player hitbox, 5 enemy hurtbox, 6 pickups, 7 interactables. Projectiles only mask what they can hit.
Queries
- Use
RayCast3D/ShapeCast3Dnodes for persistent checks (ground, line of sight, interaction). Callforce_raycast_update()for an immediate result within the same frame. - One-off checks:
get_world_3d().direct_space_state.intersect_ray(PhysicsRayQueryParameters3D.create(from, to, mask, [self_rid]))returns a dictionary (position,normal,collider,rid,face_index), or empty on a miss. Run it only in_physics_process. - Mouse picking in 3D:
camera.project_ray_origin(mouse)andproject_ray_normal, then the ray query above. Control nodes must not swallow the event first (mouse_filter). intersect_shape,cast_motionandget_rest_infowork for area-of-effect and sweeps.
Physics interpolation (smooth at any frame rate)
Turn on physics/common/physics_interpolation. Move and rotate physics-driven objects only in _physics_process. After a teleport, call reset_physics_interpolation(). Cameras that follow interpolated targets should follow in _process, or use get_global_transform_interpolated().
Ragdolls (3D)
Use Skeleton3D → PhysicalBoneSimulator3D (4.3+) → PhysicalBone3D children, created with the Skeleton3D menu "Create Physical Skeleton". Toggle with physical_bones_start_simulation()/physical_bones_stop_simulation(), and use influence to blend with animation. Active ragdolls should be driven by the simulator, not by moving the bones yourself.
Jolt specifics (default in new projects)
- Better stacking, performance and determinism than GodotPhysics.
Area3Dreports overlaps with SoftBody3D (4.7) and static bodies. - Unsupported joint parameters (bias, softness, relaxation and limit softness/restitution) print warnings. Single-body joints treat the body as
node_b(settingphysics/jolt_physics_3d/joints/world_node). WorldBoundaryShape3Dhas a limited effective size (limits/world_boundary_shape_size), and itsplane.dsign flipped in 4.7. Prefer a big box for floors.- Ray
face_indexneedsqueries/enable_ray_cast_face_index. Kinematic contacts needsimulation/generate_all_kinematic_contacts, which costs performance. - Tune limits for large worlds:
limits/max_bodies,max_body_pairsandmax_contact_constraints.
Fast objects
Bullets and projectiles: use a raycast from the last to the current position each tick (hitscan), or RigidBody3D.continuous_cd = true. Thin walls plus fast bodies tunnel otherwise.
Controllers, interaction, pushing, queries and ragdoll code (compiled by the tests): references/patterns.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

