GameObject - s&box Documentation
GameObject A GameObject is the fundamental building block of scenes in s&box. GameObjects have a transform (position, rotation, scale), can have parents and chi…
Scene.Push(), BatchGroup(), FindInPhysics, and FindAllWithTag — Scene Context Management
Scene.Push() and Scene.BatchGroup(): Scene Context Management Scene.Push() makes a scene the active scene for the duration of a scope. This is required when cre…
Prefab Instance Overrides: Property, Component, and GameObject Customization
Prefab instance overrides in s&box allow you to customize individual instances of a prefab without affecting the original or other instances. The instance remem…
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…
Performance Best Practices
s&box Performance Best Practices Community guide for writing performant s&box code based on engine behavior and developer recommendations. Object Pooling Avoid …
Scene.Trace: Raycasting, Shape Sweeps, Tag Filters, SceneTraceResult Fields, and FindInPhysics
Scene.Trace: Raycasting and Shape Sweeps in s&box is the entry point for all physics traces in s&box. It returns a builder that uses a fluent API. Basic Usage F…
ToolMode SelectionPoint and Trace Helpers
ToolMode.SelectionPoint and Trace Helpers Helper methods and data structures for toolgun selection and placement. SelectionPoint Struct Trace Methods Placement …
Prefab instance overrides — customizing instances without breaking the prefab link
Prefab Instance Overrides Prefab instance overrides let you customize individual instances without affecting the original prefab or other instances. The instanc…
BaseConstraintToolMode for Constraint Tools
BaseConstraintToolMode Abstract Class Base class for two-stage constraint tools (weld, rope, elastic, etc.) with selection point handling. Class Overview Contro…
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…
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…
NPC Ragdoll Creation with Clothing Preservation
NPC Ragdoll Creation with Clothing Pattern for creating ragdolls from NPCs including clothing preservation and bone merging. Key APIs **** — copies model, mater…
Beams - s&box Rendering Documentation
Beams Beam effects create animated lines between points - useful for lasers, lightning, energy beams, and trails. BeamEffect Component Create beams using the Be…
Undo System
Undo System Implement undo/redo functionality in editor tools. Basic Scope Capturing GameObject Changes GameObjectUndoFlags Capturing Creations Capturing Destru…
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 …
s&box ISpawner: Spawner interface
ISpawner Interface API Reference ISpawner describes something that can be spawned into the world. Implementations handle their own preview rendering and spawn l…
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…
Decals in s&box
Decals in s&box Decals are textures projected onto surfaces for bullet holes, graffiti, scorch marks, etc. Decal Component Add to a GameObject: DecalDefinition …
Prefab Instance Overrides
Prefab Instance Overrides Customize individual prefab instances without affecting the original or other instances. Types of Overrides Visual Indicators Prefab i…
LinkedGameObjectBuilder for Finding Connected Objects
LinkedGameObjectBuilder Utility class for building a set of connected GameObjects by traversing physics joints, constraints, and manual links. Class Definition …