Play Mode
Play Mode runs your game's simulation against the current scene inside the Scene View, so you can iterate without doing a full build-and-run. Press Play and your scripts start updating live; press Stop and the scene snaps back exactly as it was.
The toolbar
The Scene View toolbar carries the play controls:
| Control | Effect |
|---|---|
| ▶ Play | Enter Play mode and run the current scene |
| ⏸ Pause | Freeze the simulation (the scene stays on screen) |
| ▶ Resume | Continue a paused simulation |
| ⏭ Step | While paused, advance exactly one update frame |
| ⏹ Stop | End the simulation and restore the edit-time scene |
Ctrl+P toggles Play ⇄ Stop.
While playing, the viewport draws a coloured border — orange when playing, blue when paused — and an FPS readout in the top-left corner.
What runs
Your component scripts run their normal lifecycle and update exactly as they
would in a shipped game: awake → enable → start on Play, update every
frame, disable → destroy on Stop. The same engine.Frame context (time,
input, transform, objects, services) is injected, so a component behaves
identically in Play and in a build.
Input
Keyboard and mouse go to the game while playing. Every [Input Actions]({{< ref "input" >}}) asset in your project is applied at Play start, so action-based scripts (like the example FreeflyCamera — hold the right mouse button to look, WASD to move) work straight away.
State is never polluted
Play mode runs on its own copy of the scene. Anything the simulation does — moving objects, spawning, mutating fields — happens to that copy, never to the scene you're editing. Stop restores the pre-play state exactly, so you can play, experiment, and stop without ever saving accidental changes.
How it works (under the hood)
Because your scripts are compiled .zig files, Play compiles them — with the
engine — into a small play library that the editor loads and steps in
process, rendering the live scene into the viewport. The library is rebuilt only
when you change a script, so repeated Play presses are instant. The first Play
after a script edit pays a quick compile.
For the full design and the in-process-vs-subprocess trade-offs, see the
docs/plans/play-mode.md design note in the engine repository.