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…
ISceneLoadingEvents: Async Scene Load Hooks with BeforeLoad, OnLoad, and AfterLoad
ISceneLoadingEvents: Async Scene Load Hooks Implement on a to hook into the scene loading pipeline. The game waits for async tasks to complete before proceeding…
ConVar and ConCmd: Console Variables and Commands in s&box
ConVar and ConCmd: Console Variables and Commands s&box uses and attributes on static properties and methods to expose them to the console system. ConVar (Conso…
Citizen Characters - s&box Assets Documentation
Citizen Characters The Citizen is s&box's default human character model. It provides a standardized base for player characters, NPCs, and customization through …
Sandbox: Ownable component — prop protection with IPhysgunEvent and IToolgunEvent
Ownable Component — Prop Protection and Physgun/Toolgun Access Control The component tracks which spawned a . It implements and to enforce ownership checks when…
Dedicated Servers: Running Local Projects with Hidden Serverside Code
s&box dedicated servers can run entirely local projects as the game using the command line argument: Assets are still fetched from the cloud version of the game…
Animation - s&box Documentation
Animation s&box supports skeletal animation for characters and objects. Animate models using imported animations, blend between states, and control playback fro…
Code Generation - s&box Documentation
Official s&box documentation for Code Generation - compile-time code generation. Code Generation covers the source generator system in s&box. The generator crea…
Scene.Load and Scene.LoadFromFile: Loading Scenes, DontDestroyOnLoad, and the Loading Sequence
Scene.Load and Scene.LoadFromFile: Loading Scenes Locally loads a scene file into the current scene. This is a local-only operation — it does not bring other cl…
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…
Sandbox: UndoSystem — per-player undo stack with bounded history (128 steps)
UndoSystem — Per-Player Undo Stack The is a that maintains a per-player undo stack. Each entry holds a set of s that get destroyed when the undo is triggered. U…
ActionGraph Component Actions - s&box Documentation
ActionGraph Component Actions Add ActionGraph behavior directly to GameObjects using the ActionGraph component. Component Actions The ActionGraph component lets…
Leaderboard Web API: Public REST Endpoint with Aggregation and Filtering
The s&box leaderboard Web API is publicly accessible for querying player rankings based on stats. Endpoint Parameters stat — stat name to base the leaderboard o…
ISceneStartup: OnHostPreInitialize, OnHostInitialize, OnClientInitialize — Scene Initialization Hooks
ISceneStartup: Scene Initialization Hooks for GameObjectSystems provides callbacks for scene initialization events. It is intended for implementations, not comp…
Serverside Code: #if SERVER Blocks and .Server.cs Files for Hidden Logic
s&box supports serverside-only code that is stripped from client builds. This only works when running local projects on dedicated servers. #if SERVER Blocks Cod…
Making a Hat - s&box Clothing Documentation
Making a Hat Step-by-step guide to creating hat clothing for the Citizen character. Making Hats / Headwear Hats are worn on the head and don't need to deform wi…
s&box player management with RPC, ConCmd, and Connection APIs
s&box Player Management with RPC, ConCmd, and Connection APIs This example shows player kick/ban utilities using s&box's Connection, RPC, ConCmd, and Chat syste…
Playing Sounds - s&box Sound Documentation
Playing Sounds s&box provides multiple ways to play audio. From simple one-shots to complex 3D spatial audio with full control. SoundEvent Create reusable sound…
Code Upgrader Diagnostics: SBOX001-SBOX007 and SB3000 Roslyn Analyzer Warnings
Code Upgrader Diagnostics: s&box Roslyn Analyzer Warnings s&box ships a Roslyn analyzer () that warns about deprecated patterns and auto-fixes them. These appea…
Trigger-Based Background Music Crossfade Framework
This pattern replaces area music with a small local-client music framework. Each zone requests a target , while one controller crossfades the currently playing …