Networking Static Class: IsHost, IsClient, CreateLobby, Connect, SetData, and Debug Convars
Networking Static Class: IsHost, IsClient, CreateLobby, Connect, and Server Data The static class manages the multiplayer session in s&box. Session State Note: …
SkinnedModelRenderer Animation Parameters: Set, SetIk, SetLookDirection, Pre-Spawn Caching, and ClearParameters
SkinnedModelRenderer Animation Parameters: Set, SetIk, SetLookDirection, and Pre-Spawn Caching stores animation parameters in a dictionary and applies them to t…
Randomized Clothing for NPC Citizens using Dresser.Randomize() on Prefabs
Overview This demonstrates how to create NPC citizen prefabs with randomized clothing using the built-in component. Each time the prefab spawns or is enabled, i…
Steam filtering API for user content sanitization
Steam Filtering API in s&box s&box provides Steam filtering APIs to sanitize user-generated content like names and chat messages. This helps prevent profanity, …
Hotloading - s&box Documentation
Hotloading Whenever you save a code file in your project (.cs or .razor files), we recompile and attempt to live-reload the changed assembly. This lets you quic…
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, …
ToolMode Base Class for Toolgun Modes
ToolMode Base Class Abstract base class for creating toolgun modes in s&box. Handles input registration, action dispatch, and HUD rendering. Class Overview Acti…
Razor Panels: HTML/CSS UI with C# in s&box PanelComponent System
s&box Razor Panels use web-like HTML/CSS syntax with C# for UI creation. Panels are rendered natively (not via HTML renderer) — the syntax is a convenience laye…
Achievements and Services
s&box provides built-in services for achievements, stats, and leaderboards. Achievements Unlock an Achievement Achievement Types Stat-based - Auto-unlock when s…
s&box SceneNetworkSystem: Scene Loading and Snapshot Protocol
s&box SceneNetworkSystem: Scene Loading and Snapshot Protocol is the core networking system that manages scene loading, object spawning, and snapshot synchroniz…
s&box DupeCategory: Workshop duper categories
s&box DupeCategory Enum DupeCategory is an enum used to categorize workshop dupes for filtering and browsing. Each category has an associated icon for UI displa…
Cloud Assets: Using sbox.game Models, Textures, and Sounds in Your Project
s&box provides access to a large selection of cloud assets (textures, models, sounds) from sbox.game without manual downloading or mounting. Cloud Browser Drag …
Storage (UGC)
Manage user-generated content, save games, and player creations. Creating Entries Entry Properties Reading Files Listing Entries Deleting Entries Steam Workshop…
s&box ClientInput: Input scope for controlled objects
Client input scope struct for routing input to controlled objects. Used by ControlSystem to redirect player input during chair/vehicle control. Static Propertie…
Razor Panels: HTML/CSS UI with C# in s&box
s&box UI can be created using Razor syntax — web-like HTML/CSS combined with C#. Panels are not rendered via a HTML renderer; the syntax is a convenience layer …
Async Tasks and Coroutines in s&box Components
Async tasks in s&box run on the main thread by default, operating like coroutines. They are the recommended replacement for coroutines. Basic Async Method Frame…
Stats Service: Recording and Reading Player Statistics in s&box
Games can record per-player stats using . Stats can be queried individually, per-player, or globally. Recording Stats Increment a counter: Set a value directly:…
SceneTraceResult: All Fields and Properties from Trace Hits
is returned by and contains all information about a trace hit. Key Fields Common Usage Pattern
Playing Sounds
Playing Sounds in s&box s&box provides both 2D and 3D sound playback through code and components. Quick Sound Playback Sound Handle Store the handle to control …
Property Attributes: Inspector Customization for Components and Assets
Property attributes control how Component properties appear in the s&box editor/inspector. They work on both Components and GameResource properties. Layout and …