Physics
A plugin wrapping Rapier: rapier3d for body3d and
collider3d, rapier2d for body2d and collider2d. Both worlds run over
the same scene tree, built with Rapier's enhanced-determinism feature,
stepped on a fixed 60 Hz tick.
Declaring bodies
[[nodes]]
name = "Crate"
transform = { position = [0, 3, 0] }
body3d = { kind = "dynamic" } # dynamic | kinematic | static
collider3d = { kind = "box", size = [1.0, 1.0, 1.0] }
this.node.body3d.set(#{ kind: physics3d::BODY_DYNAMIC });
this.node.collider3d.set(#{ kind: physics3d::SHAPE_SPHERE, radius: 0.5 });
this.node.body2d.set(#{ kind: physics2d::BODY_DYNAMIC });
this.node.collider2d.set(#{ kind: physics2d::SHAPE_RECTANGLE, size: [1.0, 1.0] });
- A collider takes
kind(sphereandboxin 3D,circleandrectanglein 2D, and a dozen more each) with the matching dimensions. - Plus
restitution,frictionanddensity. - A body's
massis its total, spread over its colliders' shapes; 0 sums what they weigh. collision_layerandcollision_maskname layers 1 to 32, as Godot's do.- Scene keys and script constants use the same names.
Component handles
this.node.body2d.apply_impulse(1.0, 0.0);
- A function that drives a component is a method on that component's handle.
node.body2dbinds to the module that drives the component.apply_impulseon abody3dhandle reachesphysics3d.- Handles also carry
get(),set(table),has()andremove(). - A method no module declared for the component is an error naming it
(
node.sprite.apply_impulse). - Each component's methods are on its reference page, for example
body2d.
Driving the simulation
| Module | What is in it |
|---|---|
physics3d, physics2d | Bodies, colliders, joints, velocities and queries, one module per world |
physics2d only | max_contact_impulse(node), the strongest impact a body took this frame |
physics | Both worlds: set_paused, is_paused, clear, set_sleeping_allowed, sleeping_allowed, the debug draw, the solver's tuning and counters |
The editor pauses physics until play. Its Physics workspace draws every body's collider and centre of mass over the scene, playing or not.

The full function lists are in the script modules reference.
Determinism
- Physics steps on a fixed 60 Hz tick.
- Order-sensitive collections iterate deterministically.
- Two runs with identical inputs match bit for bit. See Determinism.