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 …
Sandbox: Stacker tool — duplicate objects in a line or arc with StackAlignMode
Stacker Tool — Duplicate Objects in a Line or Arc The Stacker tool clones a selected object N times along a configurable axis with optional rotation and gap. It…
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…
EnvmapProbe — local reflection captures with Static, Dynamic, and OnDemand modes
EnvmapProbe — Reflection Captures in s&box is a built-in s&box component that captures a cubemap at its world position for local specular reflections. The engin…
Sandbox: Duplicator tool — copy, paste, and save contraptions with DuplicationData
Duplicator Tool — Copy, Paste, and Save Contraptions The Duplicator tool copies a contraption (a connected graph of GameObjects) to JSON and pastes it back. It …
Stats API
Track player statistics with the Stats service. Recording Stats Reading Stats Stat Types Batching Stats are automatically batched and sent periodically. Call as…
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…
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…
Noclip MoveMode with Collision Toggle
Noclip MoveMode Implementation Custom movement mode for noclip/fly behavior with collision toggle. Key Patterns MoveMode inheritance — override , , priority — 1…
Physics joints — Fixed, Ball, Hinge, Slider, Spring, and Wheel
Physics Joints Joints connect two physics bodies together with constraints. All joint types are components added to a GameObject positioned at the joint's ancho…
Post-processing and camera setup — CameraComponent, PostProcessVolume, Bloom, DoF, and Film Grain
Post-Processing and Camera Setup CameraComponent Orthographic Camera Multiple Cameras (Priority) Higher priority renders on top. Use for split-screen, minimaps,…
Math types — Vector3, Rotation, Angles, Transform, TimeSince, and BBox
Math Types — Vector3, Rotation, Angles, and Transform s&box uses its own math types. Here's a practical reference for the ones you'll use constantly. Vector3 Ro…
Prefab Spawning and Cloning
Prefab Spawning and Cloning Prefabs are reusable GameObject templates that can be instantiated at runtime. Creating Prefabs Create a GameObject in the scene wit…
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…
Slot-based inventory UI with BuildHash optimization
Slot-Based Inventory UI with BuildHash Optimization This example shows a slot-based inventory UI with BuildHash() optimization to prevent unnecessary rebuilds a…
s&box Hints GameObjectSystem: UI hint queue
Hints GameObjectSystem Example Hints is a GameObjectSystem that manages the display of timed popup hints in the UI. It queues hints with delays and displays the…
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…
Code Cheat Sheet: Quick Reference for GameObjects, Components, and Transforms
Quick reference for common s&box operations covering debugging, transforms, GameObjects, and Components. Useful when you know what you want to do but not the ex…
HTTP Requests
s&box provides the static class for asynchronous HTTP requests. Allowed URLs Domains only (no IP addresses) permitted on ports: 80, 443, 8080, 8443 Use command …
Controller Input
Handle gamepad/controller input in s&box. Detecting Controllers Analog Inputs Auto-Mapped Input Haptics/Rumble Motion Controls Local Multiplayer