CleanupSystem Pattern for Map Reset and Scene Management
CleanupSystem - Scene State Management and Map Cleanup A that captures the baseline scene state and allows resetting the map to its original state. Removes spaw…
DynamiteEntity Explosive Entity Pattern
DynamiteEntity - Simple Explosive Entity A simple explosive entity that can be triggered via damage or player input. Demonstrates , , and prefab cloning pattern…
API Whitelist: Sandboxed Code Restrictions and Safe Alternatives
s&box uses a code whitelist to prevent access to classes and functions that could be used maliciously. Code that doesn't pass these checks will not be loaded in…
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.…
Mapping - s&box Editor Documentation
Mapping s&box includes Hammer, the Source 2 level editor, for creating maps and environments. Build worlds with brushes, props, lighting, and gameplay entities.…
Video - s&box Media Documentation
Video s&box can decode and play video files for cutscenes, UI elements, or in-world displays. VideoPlayer The VideoPlayer decodes video and exposes frames as a …
s&box Game Static Class: Core Game State and Operations
s&box Game Static Class: Core Game State and Operations The static class provides global access to core game state, utilities, and operations. Scene Management …
Video: VideoPlayer Decoding and VideoWriter Encoding with Streaming Support
s&box provides VideoPlayer for decoding video and VideoWriter for encoding video frames. VideoPlayer Decodes video files or URLs, exposing the current frame as …
Sandbox.Log
Sandbox.Log Static logging class for console output. Overview Log messages appear in the editor console, in-game console (press ), and log files. Logging Method…
LocalData static class: Server-side data persistence
LocalData Static Class API Reference LocalData provides server-side data persistence that survives server restarts. It's useful for storing configuration, ban l…
Explore the Engine - s&box Documentation
Explore the Engine Learn how s&box works by exploring the testbed and understanding the core concepts. Play Testbed Start s&box (not the editor) and find the ga…
Custom Editors
Custom Editors Create custom editor widgets for your classes, structs, and assets. ControlWidget (Property Editor) Create custom property editors using : Attrib…
Extensible Player Data Save Hooks for World Components
This pattern lets gameplay components plug into a player's save/load flow without putting every feature directly inside one large class. The framework has three…
s&box IKillIcon: Kill feed icon interface
IKillIcon API Reference IKillIcon is an interface for components that can display a kill icon in the kill feed or other UI elements. Type Signature Property - T…
s&box NetworkMode Enum and INetworkListener: Controlling Network Participation
s&box NetworkMode Enum: Controlling How GameObjects Are Networked controls how a participates in the network. Usage NetworkMode.Object The object has an owner (…
Sandbox.Json
Sandbox.Json JSON serialization utilities. Overview Json provides methods for serializing objects to JSON and parsing JSON strings. Serialize Deserialize Parse …
GameObjectSystem: Auto-Instantiation, Host-Controlled [Sync], RPCs, Stage Hooks, and Configuration Priority
GameObjectSystem: Auto-Instantiation, [Sync] Properties, and RPCs is a scene-level singleton that is automatically instantiated once per scene. Every non-abstra…
Scene Metadata - s&box Scene Documentation
Scene Metadata You can implement the interface in any Component that has data you'd like saved to Metadata. Metadata is data that can be accessed without needin…
s&box Hotload System: How Code Reloading Works, SkipHotload, ConVar Persistence, and NetworkObject.OnHotload
s&box Hotload System: How Code Reloading Works s&box supports live code reloading (hotload) without restarting the game. Understanding how it works helps avoid …
Sandbox: Player spawn flow with PlayerData, events, and NetworkSpawn
Player Spawn Flow in s&box Sandbox The Sandbox game uses a (a ) to handle player connections and spawning. Here's the full pattern: GameManager spawns players o…