OasisWManual 한국어
Section 7. Physics

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

PartWhereWhat it does
Physics module (Ammo)Once per project. SETTINGS → PHYSICS → IMPORT AMMO, or the prompt button in the COLLISION sectionDoes the actual simulation. Without it, Rigid Bodies stay still with no error
CollisionPer entityShape and size of the area that collides
Rigid BodyPer entityHow 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).

CollisionRigid BodyBehavior
YesDynamicFalls under gravity; bounces or stops when it hits something
YesStaticDoesn't move and blocks other objects (floors, walls)
YesNoDoesn't block objects. Instead it becomes a trigger that reports objects entering and leaving (triggerenter)
NoYesDoesn'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 Box is 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 at 1 fell 1.72 meters and a box at 0.25 fell 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 teleport to 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).
  • applyForce applies force only in the frame you call it. Calling applyForce(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 in update (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.

Next steps

Source physics/physics-overview.html