godot-physics-3d
Installation
SKILL.md
3D Physics (Jolt/Native)
Expert guidance for high-performance 3D physics and ragdolls.
NEVER Do
- NEVER move
PhysicsBody3Dnodes in_process()— Use_physics_process(). Moving bodies outside the physics step causes visual jitter and unreliable collision detection [12, 13]. - NEVER scale collision shapes directly — Scaling physics shapes causes instability, inaccurate normals, and jitter. Use the
shapeproperties (height, radius, size) instead. - NEVER modify
RigidBody3Dtransforms directly — This ignores the physics solver. Useapply_impulse(),apply_torque(), or the_integrate_forces()callback for safe manipulation [17]. - NEVER use
RigidBody3Dfor platformer player controllers — RigidBody is for objects driven by physics. For refined movement, useCharacterBody3Dwithmove_and_slide()[move_and_slide]. - NEVER leave Continuous CD (CCD) enabled for static meshes — It adds heavy CPU cost. Reserve it for high-speed small objects (bullets) to prevent them from passing through walls.
- NEVER use
PhysicsServer3DRIDs without manual cleanup — RIDs are not garbage collected. If you create bodies via the server, you MUST callfree_rid()when done to avoid memory leaks. - NEVER use
RayCast3Dfor precise ground detection on stairs — A single ray is too thin. UseShapeCast3Dwith a cylinder or sphere shape to detect walkable steps reliably [Stair Logic]. - NEVER rely on
VehicleBody3Dfor non-racing arcade vehicles — It's a complex sim. For arcade hovercraft or simple cars, a customCharacterBody3Dwith Raycasts is often easier to tune. - NEVER forget to set
collision_layerandcollision_maskproperly — If everything is on layer 1, performance will tank from redundant checks. Categorize your world. - NEVER use
Area3Dfor high-frequency blocking — Areas are for detection. For walls/barriers, useStaticBody3Dto ensure immediate, robust containment.