How physics works
Physics in OasisW runs on two components attached to an entity and a physics module you import once per project. This page explains what each of the three parts does, and the structure you need to understand why an object doesn't move or passes through something. The steps for adding them are in Add collision.
The three parts
| Part | Where | What it does |
|---|---|---|
| Physics module (Ammo) | Once per project. SETTINGS → PHYSICS → IMPORT AMMO, or the prompt button in the COLLISION section | Does the actual simulation. Without it, Rigid Bodies stay still with no error |
| Collision | Per entity | Shape and size of the area that collides |
| Rigid Body | Per entity | How it moves, mass, friction, bounce |
When you import the physics module, an Ammo folder appears in ASSETS, and ammo.wasm.js and ammo.js are added to the top of SCRIPTS LOADING ORDER in SETTINGS (checked on 2026-10-29).
Behavior by combination
These combinations were tested on 2026-10-29 (at least 1 run each).
| Collision | Rigid Body | Behavior |
|---|---|---|
| Yes | Dynamic | Falls under gravity; bounces or stops when it hits something |
| Yes | Static | Doesn't move and blocks other objects (floors, walls) |
| Yes | No | Doesn't block objects. Instead it becomes a trigger that reports objects entering and leaving (triggerenter) |
| No | Yes | Doesn't take part in the simulation. In our tests, a box with only a Dynamic Rigid Body and no Collision stayed floating at height 4 |
Kinematic is the type for objects that move by script or animation and push other objects. It isn't affected by gravity and isn't pushed back when hit. In our tests, moving a Kinematic box 2.5 meters by script (with both translate and teleport) pushed a Dynamic box in front of it (1 run each).
Gravity and units
- Set gravity in SETTINGS → PHYSICS → Gravity. The default is
0, -9.8, 0, and the launched game used the same value. - Length is in meters and mass (Mass) is in kilograms. The default
Boxis 1 meter on each side. - To give an entity different gravity, change Gravity Scale on its Rigid Body (default
1). In our tests, over 0.6 seconds a box at1fell 1.72 meters and a box at0.25fell 0.43 meters (1 run).
Moving physics-driven entities
The physics module sets the position of a Dynamic entity. Moving it from a script with setPosition can put it out of sync with the simulation. Move physics-driven entities with this.entity.rigidbody.teleport(x, y, z), and apply forces with applyForce (a continuous push) or applyImpulse (a single tap).
- Using
teleportto move a box to height 4, it fell again and landed on the floor (2 runs). - A single
applyImpulse(0, 5, 0)made a box (Mass 1) resting on the floor jump from height 0.5 to 1.73 (1 run; the jump example in Keyboard, mouse, and touch input). applyForceapplies force only in the frame you call it. CallingapplyForce(0, 15, 0)on a box (Mass 1) every frame for 1 second lifted it to height 1.08 at 0.5 s and 3.05 at 1 s; it peaked at 4.35 and came back down. Calling it only once didn't move the box (peak 0.500). To keep pushing, call it every frame inupdate(2026-10-30, 1 run each).
Receiving collisions
You receive collisions as script events. Use collisionstart between blocking objects and triggerenter for triggers. Details are in Receive collision events.