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…
Leaderboards API
Implement leaderboards using s&box Services API. Submitting Scores Reading Leaderboards Leaderboard Entry Properties Web API Access Query leaderboards from exte…
Automatic water volume setup with buoyancy physics
Automatic Water Volume Setup with Buoyancy This example shows automatic attachment of WaterVolume components to colliders tagged "water" and buoyancy physics im…
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…
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 …
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…
Physics Tracing Code Examples
Physics Tracing Code Examples Raycast and shape trace examples using — the builder pattern for physics queries. TraceResult Properties Builder Pattern Methods
Collider types — Box, Sphere, Capsule, Model, Hull, Plane, and Trigger volumes
Collider Types s&box provides several collider components for physics shapes. All colliders can be set as triggers (no physical response, just overlap detection…
Particle Effect system — emitters, manual emission, and custom controllers
Particle Effect System s&box particles are CPU-simulated and fully programmable. A particle system is built from three component types on the same GameObject: (…
Spatial audio components — SoundPoint, SoundBox, SoundscapeTrigger, DspVolume, and AudioListener
Spatial Audio Components s&box provides several components for placing audio in the world. All are alternatives to for persistent, positioned audio sources. Sou…
Sandbox: BaseBulletWeapon — hitscan shooting with BulletConfiguration, recoil, and IronSightsWeapon
BaseBulletWeapon — Hitscan Shooting with Recoil and Camera Noise extends and implements hitscan bullet firing with configurable aim cone, recoil, and camera noi…
BeamEffect — laser and energy beams between two points
BeamEffect — Laser and Energy Beams renders a beam between two points in the world. Use it for lasers, electricity, tractor beams, or any line-based visual effe…
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…
WorldPanel and ScreenPanel — HUD overlays and 3D world-space UI with Razor PanelComponent
WorldPanel and ScreenPanel — UI in the World s&box UI uses (Razor) attached to either a (HUD overlay) or (3D world-space UI). The same component works with both…
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…
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…
GameManager INetworkListener Pattern
GameManager INetworkListener Pattern Game manager implementing connection lifecycle with player spawning and cleanup. Implemented Interfaces INetworkListener - …
Controller Input
Handle gamepad/controller input in s&box. Detecting Controllers Analog Inputs Auto-Mapped Input Haptics/Rumble Motion Controls Local Multiplayer