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:…
Console Variables and Commands: ConVar and ConCmd with Flags
Console variables () and commands () let you create tweakable settings and runnable commands accessible from the s&box console. Console Commands Static methods …
Leaderboards: Stat-Based Rankings with Filtering, Centering, and Aggregation
Leaderboards in s&box are stats aggregated and ordered. They use the same stat system and provide filtering, sorting, and centering options. Basic Example By de…
Localization: Token-Based Multi-Language UI Text in s&box
s&box supports localization through token-based string replacement. Any displayed string beginning with is recognized as a localization token and replaced with …
BanSystem Pattern for Player Management
BanSystem - Player Ban Management A GameObjectSystem that manages player bans with persistent storage. Demonstrates , persistence, and RPC commands. Implementat…
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…
Async tasks in s&box — coroutines, parallel tasks, and frame-by-frame animation
Async Tasks in s&box Components s&box async tasks run on the main thread — they behave like coroutines. Use to yield one frame, to wait, and to run tasks in par…
Networking State in s&box: IsHost, IsClient, IsActive, and Lobby Management
Networking State in s&box: IsHost, IsClient, IsActive Understanding the networking state is critical for writing correct multiplayer code in s&box. Key Properti…
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 …
Storage UGC - s&box Assets Documentation
Storage UGC The Storage system manages user-generated content. Save games, player creations, and share to Steam Workshop. Creating a New Entry Create a storage …
s&box achievement unlocking with Rpc.FilterInclude targeting
s&box Achievement Unlocking with Rpc.FilterInclude This example shows achievement unlocking using s&box's Services.Achievements, Services.Stats, and Rpc.FilterI…
EmitMode enum
EmitMode Enum Controls how an emitter triggers when controlled via player input in s&box. Values Toggle Press once to turn on, press again to turn off. Hold Emi…
Input System: Button Queries, AnalogMove, AnalogLook, and Escape Override
Input is accessed using the class in s&box. It provides button state queries, analog stick/mouse values, and escape key handling for game components. Button Que…
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…
s&box networking gotchas — IsProxy, Sync, Authority, NetworkSpawn, and culling
s&box Networking Gotchas Common mistakes when building multiplayer games in s&box. IsProxy vs IsAuthority is true on all clients that don't own the object. Alwa…
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…
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 …
Sandbox.Storage
Sandbox.Storage Save and load player data. Overview Storage provides persistent storage for player data, save games, and settings with automatic Steam Cloud syn…
Sandbox.Color
Sandbox.Color RGBA color representation. Overview Color stores red, green, blue, and alpha values (0-1 range). Creation Named Colors Components Operations To/Fr…
Sandbox.Angles
Sandbox.Angles Euler angles (yaw, pitch, roll) representation. Overview Angles stores rotation as yaw, pitch, and roll in degrees — easier to work with than qua…