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 …
UIDecal Component - Render Razor UI as a Decal
A Render Component for s&box that allows you to project Razor UI onto surfaces as a Decal. Great for sticking UI onto rounded walls, curved surfaces, or any geo…
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…
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…
IsValid: Safe Null and Destroyed Object Checking in s&box
In s&box, destroying a or doesn't erase the C# reference — the variable still holds a non-null but dead object. Use instead of null checks. Common Patterns Guar…
s&box JSONObject Save Data Helper for Components
This s&box-focused sample shows how to programmatically construct and deconstruct JSON for component save data. It is useful for player saves, world unlock stat…
s&box IToolInfo: Tool information display interface
IToolInfo API Reference IToolInfo is an interface for providing tool information display in the UI, such as in the spawn menu or tool selector. Type Signature P…
IsValid Pattern: Safe Null and Destroyed Object Checks
Destroying a or doesn't erase the C# reference — the variable still holds a non-null but dead object. A plain check will pass on destroyed objects, leading to e…
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…
s&box context menu with submenus and auto-positioning
s&box Context Menu with Submenus and Auto-Positioning This example shows a context menu system using s&box's Panel, Screen, and layout system with submenu build…
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…
BaseWeapon and BaseCarryable Weapon Framework
BaseWeapon and BaseCarryable - Weapon Framework Base classes for creating weapons in s&box. Provides ammo management, view/world models, and input handling. Bas…
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…
Reusable World-Space Interaction Prompt Framework
A small, compartmentalized interaction framework can be built from three pieces: : the base component placed on objects the player can use. : the player-side ra…
Building a Networked Radio System with 3D Audio and Sync
Building a functional, interactive, and multiplayer-compatible radio system in s&box requires coordinating networked replication, local 3D audio handles, extern…
s&box ISpawnerExtensions: Creating spawner instances
ISpawnerExtensions: Creating ISpawner Instances ISpawnerExtensions provides an extension method to create ISpawner instances from type strings, supporting vario…
s&box SaveSystem: Scene save/load
SaveSystem GameObjectSystem API Reference SaveSystem is a saving/loading system that captures the differences between the current scene state and the original s…
s&box ISpawner: Spawner interface
ISpawner Interface API Reference ISpawner describes something that can be spawned into the world. Implementations handle their own preview rendering and spawn l…
Sandbox: CleanupSystem — full scene cleanup and per-player cleanup with Ownable
Sandbox CleanupSystem — Scene Cleanup and Per-Player Cleanup is a that handles cleaning up spawned objects. It distinguishes between "baseline" objects (part of…
Sandbox: ISpawner interface — custom spawner pattern with ISpawnEvents
ISpawner Interface — Custom Spawner Pattern The interface defines the contract for anything that can be spawned via the spawn menu. Implementations include , , …