A Scene is the root container for everything that exists in your game at runtime. Every mesh, light, player, trigger, and piece of logic lives inside a Scene as a GameObject. GameObjects in turn hold Components that give them behavior — but before getting to components, it helps to understand how the hierarchy itself works.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Facepunch/sbox-public/llms.txt
Use this file to discover all available pages before exploring further.
The Scene
Scene inherits from GameObject, making it both the root node of the hierarchy and a special container that owns the physics world, the render world, the directory of all objects, and the frame tick.
Only one scene is “active” at a time, exposed via
Game.ActiveScene. Code you write in components always runs inside the active scene’s tick, so Game.ActiveScene is the scene you’re operating in.Key Scene properties
| Property | Type | Description |
|---|---|---|
Game.ActiveScene | Scene | The scene currently being ticked |
Scene.IsEditor | bool | True when this scene is an editor preview scene |
Scene.PhysicsWorld | PhysicsWorld | The physics simulation for this scene |
Scene.SceneWorld | SceneWorld | The render world that holds all scene objects |
Scene.Directory | GameObjectDirectory | Fast lookup index for all GameObjects and components |
Scene.TimeScale | float | Multiplier applied to Time.Delta each tick (0–1 for slow-motion) |
Scene.WantsSystemScene | bool | Whether to additive-load the project’s system scene on startup |
Creating objects in a scene
UseScene.CreateObject() to make a new root-level GameObject without worrying about scene push scopes:
Finding objects by tag
Scene exposes two helpers for tag-based search that iterate the full Directory:
GameObjects
AGameObject is a node in the scene hierarchy. On its own it has a name, a transform (position / rotation / scale), an enabled flag, and a tag set. All actual behavior comes from the components attached to it.
Hierarchy
Every GameObject has one parent and can have any number of children. SettingParent to null automatically re-parents to the scene root.
Enabled vs. Active
Enabled is what you set. Active is whether the object is actually running — it requires the object itself and all its ancestors to be enabled.
Enabled changes, UpdateEnabledStatus propagates down through all components and children automatically.
Tags
Tags are free-form strings attached to a GameObject. Use them to categorize objects and find them with scene-wide queries.GameObjectFlags
TheFlags property on a GameObject controls editor and engine behaviour:
Destroying GameObjects
Putting it together
Here is a typical pattern: create a GameObject, configure it, add components, and parent it.Components
Add behavior to GameObjects with components
Component lifecycle
Understand when OnAwake, OnUpdate, and friends are called