Component Lifecycle Methods Reference
Component Lifecycle Methods s&box Components have a well-defined lifecycle with specific methods you can override for different phases of initialization and upd…
s&box Component Lifecycle: Exact Execution Order and Internal Guards
s&box Component Lifecycle: Exact Execution Order and Internal Guards Derived directly from and in the s&box engine source. Execution Order **** — Called once wh…
Component Lifecycle: Full Callback Order — OnAwake, OnEnabled, OnStart, OnUpdate, OnFixedUpdate, OnDisabled, OnDestroy
Component Lifecycle: Full Callback Order s&box components have a well-defined lifecycle. Understanding the exact order prevents subtle bugs. Callback Order Key …
Component execution order — OnAwake, OnStart, OnUpdate, OnFixedUpdate, and OnLateUpdate
Component Execution Order s&box calls component lifecycle methods in a defined order each frame. Understanding this order is essential for avoiding race conditi…
GameManager INetworkListener Pattern
GameManager INetworkListener Pattern Game manager implementing connection lifecycle with player spawning and cleanup. Implemented Interfaces INetworkListener - …
Component Methods: OnLoad, OnAwake, OnStart, OnUpdate, OnFixedUpdate Lifecycle
Component lifecycle methods you can override: OnLoad (async) Called after deserialization for loading. Loading screen stays open until all OnLoad tasks complete…
Component Execution Order: Lifecycle Flow and GameObjectSystem Ordering
s&box component execution order determines when lifecycle methods are called. You should not rely on the order in which the same callback gets invoked for diffe…
Player Component with Static Accessors
Player Component Main player component that manages health, damage, camera, and interfaces with the inventory system. Static Accessors Key Properties HUD Visibi…
CleanupSystem: Map reset and baseline restoration
CleanupSystem: Map Reset and Baseline Restoration This example shows the CleanupSystem which tracks the baseline scene state and allows resetting the map to its…
s&box PhysicalProperties: Physical property persistence
PhysicalProperties Component API Reference PhysicalProperties is a Component that persists physical properties (mass, gravity, health) across duplication and ne…
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: Full codebase architecture — systems, player components, weapons, tools, NPCs
Sandbox Codebase Architecture Overview The Facepunch Sandbox game is a large reference implementation. Here's a map of the major systems and how they connect. C…
Sandbox.UI.Panel
Sandbox.UI.Panel Base class for UI panels. Overview Panel is the base class for all UI in s&box. Create panels using Razor (.razor) files or dynamically in code…
WorldPanel and ScreenPanel — HUD overlays and 3D world-space UI with Razor PanelComponent
WorldPanel and ScreenPanel — UI in the World s&box UI uses (Razor) attached to either a (HUD overlay) or (3D world-space UI). The same component works with both…
s&box ManualLink: Logical link component
ManualLink Component API Reference ManualLink is a Component that creates a non-physics logical link between two GameObjects, used by the Linker tool to group u…
s&box MountMetadata: Mount fallback rendering
MountMetadata Component API Reference MountMetadata is attached to mount-spawned props to show a graceful bounding box and hint the player which game it's from …
Prefab Spawning and Cloning
Prefab Spawning and Cloning Prefabs are reusable GameObject templates that can be instantiated at runtime. Creating Prefabs Create a GameObject in the scene wit…
Scene.Push(), BatchGroup(), FindInPhysics, and FindAllWithTag — Scene Context Management
Scene.Push() and Scene.BatchGroup(): Scene Context Management Scene.Push() makes a scene the active scene for the duration of a scope. This is required when cre…
GameResource: Custom Asset Types, PostLoad, PostReload, ResourceLibrary.Get, and Resource Networking
GameResource: Custom Asset Types, PostLoad, and Resource Networking is the base class for all JSON-based assets in s&box (prefabs, scene files, custom assets). …
Drag-and-drop system with static instance pattern
Drag-and-Drop System with Static Instance Pattern This example shows a drag-and-drop system using a static instance pattern for global state management and visu…