Skip to content

Physics & Simulation

Drop, stack, collide, weld and throw. ThePrototype has a real-time rigid-body simulation (Rapier) you can start at any moment — objects fall, pile up and knock each other over, and everyone in the session watches the same run.

The simulation is not always on: you set up which objects have physics, then press play. Stopping leaves the result in place as a single undoable step.

Giving an object physics

There are two ways to make an object participate, and they combine.

From the Inspector

Select an object and open its Physics section in the Inspector. Body is the first choice:

  • Auto (scenery) objects act as static obstacles the simulation can land on (the default).
  • Dynamic objects fall and collide; give them a Mass (0.1–100, default 1).
  • Static never moves.

The rest of the section — the collider shape, the material (bounciness and friction), sensors, locked axes and Show collider — is described on its own page: Colliders. In short: the collider shape is inferred from the object (a sphere rolls, a ramp is a ramp), a Sensor stops colliding and fires On Enter / On Exit instead, and every one of these settings can be changed while the simulation runs. A dynamic object can also float in water, and since 1.74 it can have its own gravity scale and drag: a feather, a balloon, a parachute.

To give a whole selection physics at once, Configure Scene ▸ Physics lists every object that will get a body (dynamic · 1 kg, static, collider only; click a row to select it) and has an Enable physics on selection button that makes the selected objects dynamic.

Continuous collision, per object

New in 1.40. A dynamic body has its own Continuous collision row in Properties ▸ Physics:

Choice What it does
Scene default (the default) follows Configure Scene ▸ Physics ▸ Continuous collision; the row says whether that is on or off
On this body always gets continuous collision — for bullets, thrown balls and anything fast and small
Off this body skips it, in a scene that has it on (it costs a little speed per body)

Continuous collision (CCD) stops a fast, small body passing straight through a thin wall between two physics steps — a 5 cm ball at 60 m/s moves a metre per step. A throw faster than 5 m/s still turns it on for that body until it comes to rest, whatever the pick. The pick is shared with everyone, saved with the scene and applies to a running simulation at once; Scene default saves nothing, so older scenes are unchanged.

Scene settings

Everything in Configure Scene ▸ Physics is shared with your peers, saved with the scene and applied live — you can change any of it mid-run.

World

Gravity slides from −20 to 5 (Reset gravity puts it back). Drop the world into moon gravity mid-run, or invert it: positive values make things fall up.

Time scale (0.1–2) runs the whole simulation in slow motion or fast forward. Slow-mo on a collapsing tower is the point of it. Above 1.5 the panel suggests turning on continuous collision, because faster bodies travel further between steps.

Ground & bounds

A ground plane is on by default at height 0. You can move it, give it grip (friction) and bounce (restitution) — a slick floor and a rubber floor are one slider apart — or switch it off entirely to build a pit. With colliders shown (Configure Scene ▸ View ▸ Show colliders) it draws as a translucent sheet so you can see where it is.

Since 1.25 the ground has a hole wherever water goes below it, with a floor at the bottom of the pool or tank — so a pool sunk into the ground works, and nothing rests on an invisible lid at the water's surface.

Out of bounds below Y catches anything that falls past a limit, and you choose what happens:

Action What it does
Return to its start teleports the object back to where it was when the simulation started — right for a crate knocked off a table
Freeze in place stops it dead where it is
Delete the object removes it, replicated and undoable

One toast reports a whole burst ("3 objects fell out of bounds — returned to spawn") rather than one per object.

Defaults (advanced)

Material fills in friction and bounce for every object that does not set its own — the fastest way to make a whole scene icy, rubbery, wooden or metallic. Drag and spin drag (linear and angular damping) are what turn a jittery tower stable and stop crates sliding forever. Continuous collision is off by default and costs a little speed (each body can override it); thrown objects switch it on for themselves regardless, because a 20 m/s throw travels 0.33 m per step and would otherwise pass through a thin wall.

Primitives are ready to play

Newly added primitives (cube, sphere, stairs…) come with a Dynamic body (mass 1) out of the box — add a few, press P, and they fall, stack and throw immediately. Building scenery instead? Set Body back to Auto or Static in the Inspector. Terrain always spawns as scenery.

With Mass / Bounciness / Friction nodes

The flow graph can drive the same properties: wire a Mass, Bounciness or Friction node into an Object Selector. A wired Mass node makes its object dynamic. Node values override the Inspector settings for that object.

Note

Physics properties are not animated per frame like Spin or Bounce: they are applied when the simulation starts, and re-applied live whenever you change them mid-run — mass, material, collider, sensor and locked axes swap in place. Only switching an object's Body (Auto / Static / Dynamic) waits for the next run.

Running a simulation

You can start and stop the sim three ways:

  • Press P — toggles the simulation.
  • Right-click the viewport ▸ Tools ▸ ▶ Simulate physics (the same entry becomes ■ Stop simulation, and Pause / Reset appear while it runs).
  • The Simulation controls HUD — a small transport at the bottom-right, if you've enabled it (see below).

While running, dynamic objects fall under gravity and collide; Reset restores the initial layout without an undo entry, Pause/Resume freezes the sim, and Stop ends it — after which Ctrl+Z restores the layout you started from.

Since 1.64 a level made only of static objects — walls, floors, a sensor doorway — runs its physics world when Play starts, so walls stop you and On Enter zones notice you without a simulation of your own. For gravity, jumps and climbing onto boxes, add a Character Controller node set to walk.

If nothing has physics when you press play, the app helps you out: with an object selected it simulates just that object at mass 1 and tells you "No Mass nodes wired — simulating the selected object with mass 1"; with nothing selected it prompts you to wire a Mass node or select something first.

The simulation controls HUD

The bottom-right transport (Play, Pause, Stop, Reset) is off by default so it isn't confused with the main play button. Turn it on in Settings ▸ Scene ▸ Simulation controls. The P shortcut works whether or not the HUD is visible; the first time you use P while it's hidden, a toast reminds you where to enable it.

In a scene that has Start simulation on load on, the transport is always there. Since 1.25 it drives the whole simulation: Pause holds everything still — the bodies, the fluid tanks, fluid emitters and the pouring and spilling drops — on every player's screen, and Reset puts the whole scene back to how it opened (bodies, tanks refilled, drops gone) and plays it again.

Start simulation on load

Configure Scene ▸ Camera ▸ Start view ▸ Start simulation on load is for scenes that are a simulation — things falling, floating, jiggling or pouring. It is saved with the scene: when the scene opens, physics starts by itself once everything has loaded. The person who opens the scene runs it; everyone else sees it move. It also applies to exported games and play links, and undo / redo work on it like on any edit. Jelly room, Fluid tank toy, Pool party and Island ocean have it on.

Configure Scene ▸ Camera ▸ Start view: Hold camera until loaded off, and Start simulation on load ticked with its note. 1: Start simulation on load.

Configure Scene ▸ Camera ▸ Start view with Start simulation on load ticked.

  1. Start simulation on load: the scene starts its physics by itself once everything has loaded.

Grab and throw mid-simulation

While a simulation is running you can grab a dynamic object and throw it:

  • Play mode — enter play mode, put the crosshair on the object and hold the left button. It comes to you and follows the camera; scroll to push it further away or pull it closer; let go to throw. See below.
  • Desktop editor — drag it with the move gizmo. Releasing hands it back to the physics engine with the velocity of your throw.
  • Interact mode — press on it and drag, with a finger or the mouse; see Carrying things in Interact.
  • VR — grip-grab it and let go; the release imparts the throw.

Throw speed is capped at 20 m/s, and the cap applies to the magnitude, so a hard diagonal throw goes where you aimed it rather than being bent toward an axis.

Carrying things in Interact

With a simulation running, press on a dynamic object in Interact mode and drag: the object is held at the exact point you touched and moves with your finger or cursor, at the same distance from the camera — near or far — so it no longer jumps toward the camera when you take it. Let go while still moving to throw it; a slow release puts it down. Throws from Interact are capped at 8 m/s. With a mouse, the wheel pushes the held object away or pulls it closer. A second finger never drags the held object.

Play mode is interact mode

In play mode the crosshair grows into a ring over anything you can pick up.

  • Hold the left button to carry. The object follows a smoothed target in front of the camera, so a heavy crate lags behind a light one — mass you can feel.
  • Scroll while carrying to push it out or pull it in (0.8–6 m). Your walking speed is untouched while you hold something.
  • Let go to throw it with the speed you were actually moving it at.
  • A quick tap — press and release without dragging — clicks the object instead, which fires On Click nodes and module buttons. Before this, play mode had no clicking at all.

Only dynamic objects can be picked up, objects another peer has locked are refused, and nothing is grabbable unless a simulation is running — so scenery and level geometry can never be dragged out of place.

Configure Scene ▸ Play sets this for everyone in the scene (since 1.30 it is its own section; before, it was Physics ▸ Play mode):

Setting Meaning
Pointer: Grab and throw the full behaviour above (default)
Pointer: Click only taps fire On Click nodes, nothing can be picked up
Pointer: Look only neither
Limit grab reach · Reach (m) off by default; when on, you can only pick up objects within this distance of your body (0.5–5 m, 1.3 when switched on) — Towers uses it so high pieces need steps
Flying Off (default) / Allowed / Removed — see Flying
Start the simulation when play mode opens for scenes that are games rather than models
Players of the published game can share moments off by default; when on, players of the published game (play link, embed, export) can share a moment — the last 10 s as a GIF or MP4. In the editor everyone can. Since 1.68
Playing banner while you play, a small bar at the top says Playing · Press Esc to stop (with a Stop button). Show (default), Hide (also on a phone), or Custom — your own words, up to 80 characters. In a game it says Press Esc for the menu and the game's Menu · Esc button stays. Since 1.30
Spawn point where desktop play starts. Set to the view's focus stores the point the view orbits around, facing the way the camera looks at it; Clear removes it

A module can override these for its own world by publishing them on its scene group.

The screen stays awake

Since 1.74. While you play, film (Film mode), record a video, or watch another player (for example while someone else wears the headset), the screen does not dim or lock. A paused game and leaving Play let it sleep again. There is no setting.

It needs a browser with Screen Wake Lock: Chrome, Edge, Safari 16.4 (iOS 18.4), Firefox 126 or the Quest Browser. Elsewhere nothing changes.

Flying

Since 1.26 players walk in Play unless the game allows flying. (Before, every scene without Keep players on the ground ticked flew on a desktop.) Configure Scene ▸ Play ▸ Flying:

Choice What it means
Off (default) players walk; the camera stays at eye height. A game module may still allow flying
Allowed Q / E on a desktop, the Up / Down touch buttons, and in VR Interact, flying with the stick along where the controller points
Removed nobody flies in this scene, even if a game module or a Character Controller node in fly mode asks for it

Configure Scene ▸ Physics ▸ Play: Pointer, Limit grab reach, Flying set to Allowed, the simulation switch and the spawn point. 1: the Flying choice, Off, Allowed or Removed.

Configure Scene ▸ Physics ▸ Play mode.

  1. Flying in Play: Off (players walk), Allowed (Q / E fly), or Removed (even a game module cannot turn it on).

Of the bundled games, the Jam Room flies (it is designed for VR flying), and Dungeon Realms does when its Game Rules ▸ disableFlight is off; every other game walks. A module allows flying with userData.play.locomotion.fly = true (or by un-grounding play), and a Character Controller node in fly mode counts as allowing it. The editor's free-fly — WASD + Q/E, and flying in VR Edit — is unchanged.

The knock

Hit a floating object with your hand and it flies off. In VR your two hands are the probes; on desktop it is the camera you walk with, so walking into something shoves it. The object leaves at the speed you hit it, and everybody sees the same result — the hit travels as one exact velocity message, the way a throw already does.

It is off in every scene that does not ask for it. A scene with no Knock block behaves exactly as it always did: hands grip and grab, the crosshair carries and throws, and nothing is knocked by walking into it. Switch it on in Configure Scene ▸ Physics ▸ Knock:

Row Range What it does
Hands and players knock dynamic objects off by default arms the whole thing for the scene, for everyone
Gain 0 – 5 multiplies the speed the object leaves at. 1 is "as hard as you hit it"
Max speed 0.5 – 20 m/s the ceiling, whatever you do. Keep it low to keep a ball hittable rather than lost
Probe radius 0.02 – 1 m how big the hand (or head) is as a ball. Wider is easier to connect with, and easier to hit by accident
Spin 0 – 2 how much of the hit becomes rotation instead of travel

The panel says the rest out loud: An open VR hand, or walking into an object on desktop, sends it off at the speed it was hit. Grip still grabs. Shared, and it needs a running simulation.

Three things have to be true before anything is knocked: the scene's Knock block is on, a simulation is running somewhere, and you are in play (pointer lock on desktop, or presenting in VR). Only Dynamic bodies can be knocked, and an object somebody is carrying is left alone rather than fought over. The settings are scene data: they replicate, save and undo like everything else in Configure Scene.

In VR the hand that connects gets a short buzz, harder for a harder hit. That part is local — it is your hand, not a message.

The knock as a game

Menu ▸ Templates ▸ Games ▸ Stars Room is a zero-gravity room built on this: twenty-four stars and two planets to knock about, a chime when one is hit, and a start screen with Start round (light every star in two minutes) or Free play. Nothing to install.

To react to a knock in a graph, use the On Hit node: it gives you how hard (speed) and whether it was you (by me).

Things float (buoyancy)

Drop a dynamic object into water while a simulation runs and it floats, sinks or drifts. The water pushes it up by as much water as it displaces, slows it down, carries it along in its flow (the River preset), and tips it back upright. Hitting the surface makes a ripple.

Since 1.25 that works wherever the object starts: put it anywhere in a pool, a tank or the ocean and press P (or open a scene with Start simulation on load) — a light thing (foam, a beach ball) shoots up and bobs at the surface, wood floats lower, a stone sinks to the bottom. Properties ▸ Water ▸ Flow & physics on the water adds Flow up (an upward current) and Bob damping (lower = things keep bobbing longer).

Pool party seen from the deck at water level: a beach ball, a lilo, two swim rings and a rubber duck floating in a pool sunk into the ground. 1: a toy floating at its waterline.

Toys floating in a pool sunk into the ground.

  1. The beach ball floats at its waterline: the water pushes it up by as much as it displaces.

A wooden crate floating in a pool, selected, with its Physics properties open: Floats set to Wood, Density 600, Buoyancy × 1 and the note that it floats about 60% under. 1: the Floats choice. 2: the crate at its draft.

A wooden crate floating in a pool.

  1. Floats as: what the body is made of in water — Wood floats about 60 % under.
  2. The crate rests at its draft: 60 % of it under the surface.

Select the object and open Properties ▸ Physics (Body: Dynamic) ▸ Floats:

Floats Density (kg/m³) Behaves like
Auto (default) 500 floats half under
Foam 150 rides high on the surface
Cork 240 floats, mostly above
Wood 600 floats a little more than half under
Ice 917 floats almost all under
Rubber 1100 sinks slowly
Stone · Metal 2500 · 7800 sinks
From mass ÷ volume from the object works it out from the object's mass and size
Off — ignores water

Density (kg/m³; water is 1000) and Buoyancy × fine-tune it. Water drag × (since 1.81) sets how hard the water slows it: lower drifts on, higher holds still. The hint under the sliders says how deep it will sit, in metres since 1.81 — Floats about 60% under: 0.6 m of its 1 m height (600 kg/m³; water is 1000). How deep something floats depends on its density, not its mass, so a light and a heavy crate of the same wood float equally. From mass ÷ volume is the exception: there the mass sets the density.

A cube can tip onto an edge

A cube between about 21 % and 79 % of water's density is not stable lying flat: it tips onto an edge and floats that way, as a real one does. The hint then adds At this density it tips over and floats on an edge. A lighter or heavier cube, or a flatter box, floats flat.

An AI app or agent sets the same choices with set_physics and is told where the waterline will sit.

The peer running the simulation computes the floating, and everyone sees the same motion; each player draws the ripples for themselves. Water volumes are in the Water collision group, which is why things fall into them instead of landing on top. For a tank of particle fluid you can pour, see Fluid tank.

Joints

Joints tie two objects together. Select exactly two objects, then use their right-click menu ▸ Physics, or Properties ▸ Physics ▸ Joints ▸ Add joint. The first object you selected is the base (a), the second is the attached one (b).

Entry Joint Use it for
Weld together Fixed: the two move as one rigid body a handle on a crate, a statue on its plinth
Hinge (X / Y / Z axis) Turns about the first object's local axis, at the second object's origin a door, a lever, a wheel
Ball joint Swings and twists every way about the second object's origin a wrecking ball on a rod, a ragdoll shoulder
Slider ▸ X / Y / Z axis Moves only along the first object's local axis a piston, a drawer, a lift
Spring Pulls the two origins back to the distance they had when joined a bouncy seat, a car's suspension
Rope The two origins can get no further apart than they were when joined; closer is free a hanging lamp, a swinging sign
Detach joints (N) Removes joints touching the selection

Ball joint, Slider, Spring and Rope are new in 1.74.

Joints replicate to everyone, undo as a single step, persist in saved scenes and .tpscene files and, since 1.74, across a reload of the page (before, a reload restored the objects but not their joints). They are removed automatically if one of their objects is deleted. Hinges can also be motorized programmatically (for example by the drivable-car module) to spin under power, or driven to an angle to steer.

Tuning a joint

Properties ▸ Physics ▸ Joints lists every joint touching the selected object(s), with its kind and both objects:

  • Hinge and Slider: Axis (X / Y / Z of the first object) and Limits — a minimum and maximum angle in degrees for a hinge, a minimum and maximum distance in metres for a slider, measured from where it was joined.
  • Spring: Rest length (metres), Stiffness (10 is soft, 500 is stiff; default 50) and Damping (how fast the bounce dies away; default 2).
  • Rope: Length — the furthest apart the two points can get.
  • The two collide: switch off for parts that sit inside each other (a wheel in its arch).
  • The bin button deletes the joint; the objects stay.

Every change replicates, undoes as one step and reaches a running simulation at once: lengthen a rope mid-run and the lamp drops to the new length.

Seeing joints

Select a jointed object and its joints are drawn in the viewport: a small cross at each anchor, a blue line for a hinge's or slider's axis, amber for limits (the arc a hinge may turn through, the travel of a slider between two ticks), a green zigzag for a spring, and the rope itself — grey while slack with an amber tick where it would go taut, orange when taut. Show colliders draws every joint in the scene. The drawings are yours only, never saved or sent, and are hidden in Interact and Play.

Good to know

  • Build joints on unrotated objects (as the Joint node page warns), then rotate the finished assembly.
  • A hinge's limit arc shows the size of the range, measured from the pose the hinge was made in.
  • A scene with the new joints opened in an app older than 1.74 holds them as welds (an older app only knows weld and hinge). A joint kind from an app newer than yours is left out of the simulation rather than guessed at.

Duplicating jointed objects

Since 1.27, duplicating both objects of a joint (select both, Ctrl+D) copies the joint onto the copies too. Duplicating only one end does not: the copy is a free object, as before. One Ctrl+Z removes the copied joint, the next one the copies.

Breaking a joint during a simulation

Since 1.27 Detach joints while a simulation runs breaks the joint for real: the objects come apart at once (before, the joint held until you restarted the simulation), sparks fly from where it was attached, and any particle emitter set to On impact on either object fires. Every player sees it. Detaching while no simulation runs is quiet.

How it stays in sync

Physics uses an authoritative model: the peer who starts the run is the only one stepping the simulation, and it broadcasts the resulting motion. Everyone else just watches.

  • One run at a time — if someone else is simulating, your play button is disabled and a toast names who's running it.
  • Two people pressing play at the same moment both start a run for an instant; the one with the lower peer id keeps it, and the other sees "‹name› is simulating too — handing the physics over (lower id keeps it)".
  • Someone joining mid-run is told the run is happening, so their grab and their knock work from the first second instead of after the next restart.
  • Watching peers interpolate. The simulating peer sends about ten poses a second per moving body; everyone else eases between them instead of snapping, so a fast throw looks smooth rather than stepped. It costs nothing on the wire and never changes where an object ends up — only how it gets there. Since 1.91 this holds on a screen that draws slowly too (a background tab, a slow device): bodies no longer crawl and jump there.
  • A throw you make is applied exactly. When you are not the peer running the simulation, releasing an object sends the release velocity itself, so the object leaves your hand immediately and in the direction you threw it rather than being reconstructed from position updates.
  • The fastest device runs the physics (since 1.64). While a simulation runs, every peer reports its frame time; when another device is clearly faster (at most 60 % of the runner's frame time, for 3 s), the run moves there — bodies keep their speed, and Stop's undo and Reset still go back to where the run began. It never moves to an AI agent's tab or a view-only peer. Since 1.89 it never moves in the middle of Play either: a device that is playing keeps running its own physics even when it is slow, and the run waits until that player leaves Play.
  • Every player collides with the level (since 1.89). In a shared game, each player's own device keeps them out of walls, gates and steps, and moving objects another device simulates block you where you see them. The simulation itself (falling crates, pushes, joints) still runs on one device. Pickups, sensors, checkpoints and portals are judged by each player's own device for their own player, and counted once. If the player whose device runs the physics leaves, everyone else keeps the level's walls until they leave Play.
  • Another player takes over when the host leaves (since 1.91). In a shared game, when the player whose device runs the physics leaves (closes the tab, reloads or loses the connection), another player in the game takes over: moving objects keep moving, and the game's counters, sensors and scores keep going. After a lost connection the game resumes after 15-25 s and says "The game's host left. ‹name› now runs it." Viewers never take it over; a room with only viewers left pauses and says so.
  • Physics stopped in Play (too slow for this device, or a step that failed) holds you in place instead of letting you walk through every wall, and a card says why, with Resume (or P). Looking around still works.
  • The sim uses a fixed timestep, so it runs at the same speed for everyone even when a browser tab is throttled in the background. Since 1.64 a slow device that runs the physics alone keeps real time too — it takes more catch-up steps per frame, sized from what a step costs on that device — instead of falling into slow motion.
  • Kinematic platforms that are themselves animated by the flow graph need no extra traffic — every peer computes their motion identically.

Tip

Build a Rube-Goldberg contraption: weld a few blocks into a paddle, hinge it to a post, give a ball Mass and Bounciness, then press P and watch it play out the same on every screen.