Physics Events - s&box Physics Documentation
Physics Events Receive callbacks for physics events in the scene. IScenePhysicsEvents Implement this interface on a component to receive scene-wide physics even…
Component.OnLoad: Async Loading Pattern — LoadingContext, Scene.IsLoading, and Loading Screen Integration
Component.OnLoad: Async Loading Pattern for Components Components can perform async loading work by overriding . This is the correct way to load resources async…
Scene Object Index: How Scene.GetAll Works — Type Hierarchy Indexing, Update Sets, and Hotload Safety
Scene Object Index: How Scene.GetAll<T> Works and Why It's Fast is the primary way to find all active components or systems of a type in the scene. Understandin…
GameObjectSystem with [Sync] and RPCs: Networked Scene-Level State
GameObjectSystem with [Sync]: Networked Scene-Level State supports properties just like components. However, there is a key difference: all properties on a are …
Scene Metadata: ISceneMetadata for Queryable Scene and Prefab Data
The interface in s&box allows Components to save data that can be accessed without loading a Scene or cloning a Prefab. Metadata is accessible via or directly. …
Prefabs: Reusable GameObjects with Runtime Spawning via Clone
A prefab is a GameObject that can be used in multiple places — across scenes or instantiated at runtime. Assets Prefabs are saved as PrefabFile assets. To creat…
RealTime vs Time: Wall-Clock vs Scene Time — RealTimeSince, RealTimeUntil, GlobalNow, and SmoothDelta
RealTime vs Time: Wall-Clock vs Scene Time — When to Use Each s&box has two time systems. Choosing the wrong one is a common source of bugs. Time (Scene Time) ,…
GameObjectSystem - s&box Scene Documentation
GameObjectSystem GameObjectSystems are global systems that operate on groups of GameObjects. Unlike Components which are attached to single GameObjects, systems…
Sandbox: CleanupSystem — full scene cleanup and per-player cleanup with Ownable
Sandbox CleanupSystem — Scene Cleanup and Per-Player Cleanup is a that handles cleaning up spawned objects. It distinguishes between "baseline" objects (part of…
NetworkHelper — quick multiplayer setup with auto-server and player spawning
NetworkHelper — Quick Multiplayer Setup is a built-in s&box component that handles the boilerplate of starting a server and spawning players. It's the fastest w…
Engine Frame Loop Order: FrameStart, Scene Tick, and FrameEnd Sequence
Engine Frame Loop Order The s&box engine frame loop runs in a specific order each frame. Understanding this is important for knowing when your code runs relativ…
Execution Order - s&box Documentation
Execution Order Understanding the order in which component methods are called. Flowchart Component lifecycle follows a specific order: Constructor — Object crea…
Sandbox: BanSystem — persistent ban list with INetworkListener.AcceptConnection
Sandbox BanSystem — Persistent Ban List with INetworkListener is a that implements to intercept incoming connections and reject banned players before they join.…
Clutter System — scattering grass, rocks, and debris with GPU instancing
Clutter System — Scattering Grass, Rocks, and Debris The Clutter System scatters large amounts of small objects (grass, rocks, debris) across a scene using GPU-…
Component Editor Tools: Selection-Based Scene View UI and Gizmos
Component Editor Tools in s&box are always active when a specific Component is selected. They create UI in the scene view and can override input. An example is …
LocalData persistence for server-side data
LocalData Persistence in s&box LocalData provides server-side data persistence that survives server restarts. It's useful for storing configuration, ban lists, …
Your First Project - s&box Documentation
Your First Project Creating Game Objects In s&box, everything in your scene is a GameObject. GameObjects can have Components attached to them that provide funct…
GameObjectFlags: DontDestroyOnLoad, NotNetworked, Absolute, and Destroy vs DestroyImmediate
GameObjectFlags: Controlling GameObject Behavior is a flags enum that controls special behaviors for GameObjects. Values Usage ```csharp // Survive scene loads …
Unit Tests: MSTest with Engine Initialization for Component Testing
s&box supports unit testing via a directory in your project. The engine auto-generates a test project when this directory exists (restart editor after creating …
Scene Events: Interface-Based Broadcasting and Listening
s&box uses interface-based events to broadcast and listen to events within a scene. Events are sent to active Components and GameObjectSystems — they are NOT se…