Collision and Triggers
Working with physics collisions and trigger volumes. Collision Components Basic Collision Trigger Volumes Triggers detect overlap without blocking movement: Col…
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 …
Input Handling Code Examples
Input Handling Code Examples Comprehensive input examples covering buttons, analog sticks, mouse, controller, and VR input. Default Input Actions
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…
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
SpawnPoint and TriggerHurt — spawn locations and damage trigger volumes
SpawnPoint and TriggerHurt in s&box SpawnPoint is a built-in s&box component that marks a world location for player or NPC spawning. uses to find valid spawn lo…
Controller Input
Handle gamepad/controller input in s&box. Detecting Controllers Analog Inputs Auto-Mapped Input Haptics/Rumble Motion Controls Local Multiplayer
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…
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…
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…
Sandbox: BaseCarryable — unified AimRay, WeaponModel resolution, and seat-aware damage
BaseCarryable — Unified Weapon Base with AimRay and Seat Support is the root class for all holdable items. It handles viewmodel/worldmodel management, a unified…
UndoSystem: Per-player undo functionality
UndoSystem: Per-Player Undo Functionality This example shows the UndoSystem which provides per-player undo stacks for tracking spawned objects and allowing play…
Chat UI Pattern with RPC Broadcasting
Chat UI with RPC Broadcasting A Razor UI component for game chat that handles local input, RPC broadcasting, Steam filtering, and automatic message expiration. …
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…
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…
VirtualGrid — efficiently rendering large scrollable lists in s&box UI
VirtualGrid — Efficiently Rendering Large Lists in UI is a s&box UI panel that virtualizes a large collection — only the visible cells are created in the DOM. S…
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…
Sandbox: UndoSystem — per-player undo stack with bounded history (128 steps)
UndoSystem — Per-Player Undo Stack The is a that maintains a per-player undo stack. Each entry holds a set of s that get destroyed when the undo is triggered. U…