Sandbox
A self-contained setup with scripts of its own. Press Play and they run; press Stop and everything they changed goes back, while your own edits stay.
A Sandbox is a script scope with its own Luau VM. In Play mode (F5) its InitScripts run, and Stop puts back what they changed inside it. Its Viewport image is what viewports show. Insert > All > More > Sandbox makes one with an Init script, a Viewport image and a Scene DataModel. Its Explorer icon is green while it runs. A Sandbox inside a DataModel or another Sandbox doesn't run, and one Sandbox's scripts can't require another's modules.
Example
local box = script.Parent
local studio = box.DataModels.Studio
local crate = studio.Props.Crate
Root.Heartbeat:Connect(function(dt)
crate.Position = Vector3.new(13, 1.5 + time(), 7)
studio:RenderTo(box.Viewport)
end)Properties
| Name | Type | Default | Description |
|---|---|---|---|
| Running | boolean | Whether Play mode is on; read-only. |
From Instance 22
Subclasses
