ControlSystem Pattern for Seat/Vehicle Control
ControlSystem - Seat/Vehicle Control Management A that manages control transfer between players and seated entities (vehicles, chairs). Handles input routing an…
Controller Input
Handle gamepad/controller input in s&box. Detecting Controllers Analog Inputs Auto-Mapped Input Haptics/Rumble Motion Controls Local Multiplayer
ControlSystem: Vehicle seat control with IPlayerControllable
ControlSystem: Vehicle Seat Control with IPlayerControllable This example shows the ControlSystem which manages vehicle seat control, sorting seats by occupatio…
Sandbox: ControlSystem — vehicle seat and contraption control with IPlayerControllable
ControlSystem — Vehicle Seat and Contraption Control is a that drives components on contraptions. When a player sits in a , the system walks the connected contr…
Input Handling Code Examples
Input Handling Code Examples Comprehensive input examples covering buttons, analog sticks, mouse, controller, and VR input. Default Input Actions
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 …
CharacterController — capsule movement, ground checks, and velocity control
CharacterController in s&box is a built-in s&box component for capsule-based movement. Unlike , you control velocity directly — the controller handles collision…
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…
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: (…
Sandbox: BaseWeapon — ammo system, reload, shoot delay, and IPlayerControllable
BaseWeapon — Ammo, Reloading, and Firing Pattern extends and adds ammo management, reloading, and a shoot delay system. It implements so it can also be used fro…
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 …
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…
Collision and Triggers
Working with physics collisions and trigger volumes. Collision Components Basic Collision Trigger Volumes Triggers detect overlap without blocking movement: Col…
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…
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…
Camera and View Control
Working with cameras and player viewpoints in s&box. Main Camera Access Creating a Player Camera First-Person Camera Screen to World Ray World to Screen Camera …
s&box DemoRecording with DefaultMovieRecorderOptions
s&box DemoRecording with DefaultMovieRecorderOptions This example shows how to configure s&box's MovieRecorder system using the [DefaultMovieRecorderOptions] at…
Rigidbody Physics
The component enables physics simulation on GameObjects. Basic Usage Rigidbody Properties Forces Collision Detection Wake/Sleep Spawn with Velocity
ConVar and ConCmd — console variables and commands with flags and game settings
ConVar and ConCmd — Console Variables and Commands and are s&box attributes for exposing variables and commands to the developer console. Console Commands Conso…
BanSystem Pattern for Player Management
BanSystem - Player Ban Management A GameObjectSystem that manages player bans with persistent storage. Demonstrates , persistence, and RPC commands. Implementat…