Sandbox: ThrusterEntity and WheelEntity — contraption propulsion with ClientInput bindings
ThrusterEntity and WheelEntity — Contraption Propulsion Components Both and implement and use properties so players can bind them to keys from a vehicle seat. T…
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…
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 …
IPlayerControllable example: ThrusterEntity
IPlayerControllable Example: ThrusterEntity ThrusterEntity demonstrates how to implement IPlayerControllable for a thruster that responds to player input while …
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…
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…
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…
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: NPC system — Schedule, Task, and Layer architecture
NPC System — Schedule, Task, and Layer Architecture The Sandbox NPC system uses a layered architecture: Layers handle continuous behaviours (navigation, senses,…
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…
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…
Custom GameResource assets — defining asset types with ResourceLibrary and PostLoad registry
Custom GameResource Assets lets you define your own asset types with a custom file extension, inspector UI, and hot-reload support. Assets are JSON files under …
Sync Properties for Networked State
Sync Properties for Multiplayer The attribute automatically synchronizes property values to all clients when they change. Basic Sync Sync Flags Customize sync b…
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…
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…
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…
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: 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…
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
Component Event Interfaces for Tool Interactions
Component Event Interfaces (IPhysgunEvent, IToolgunEvent) Event interfaces that allow components to respond to tool interactions. These use s&box's pattern for …