guide

Units & colliders

One unit is one meter; colliders track gameplay surface, not visual detail.

⌖ Explore the library in 3D →

Units

const { unit } = useWorld()
const tableHeight = 0.75 * unit // 75 cm

Colliders

Every component registers its own physics colliders via a Rapier RigidBody. The guiding rule: collider complexity should match gameplay surface, not visual detail. A bookshelf is one cuboid you can’t walk through — not one collider per book.

ShapeWhenExample
cuboidBox-like solidsBookshelf, walls, crates
Several fixed cuboidsComposed structuresRoom (4 walls + floor)
Convex hullFaceted irregular solidsRocks
TrimeshArbitrary surfaces where visual = collisionTerrain

Trimesh is the most expensive — reach for it only when a shape genuinely needs arbitrary geometry (displaced terrain). Prefer cuboids and hulls everywhere else.

Turn on <World debug> to see collider wireframes while building.