Components - s&box Documentation
Components A Component is added to a GameObject to provide functionality. This functionality can vary wildly. You could add a component that renders a model at …
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…
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…
s&box UndoSystem: Per-player undo stacks
GameObjectSystem that provides per-player undo stacks with 128-step limit. Tracks GameObjects for destruction on undo. Classes PlayerStack Per-player undo stack…
GameObject.FindNetworkRoot() extension method
GameObject.FindNetworkRoot() Extension Method This example shows an extension method for finding the network root of a GameObject hierarchy. Usage Example Key F…
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…
s&box TriggerTeleport: Trigger-based teleportation
TriggerTeleport Component API Reference TriggerTeleport is a Component that teleports objects that enter its trigger collider to a target GameObject. Type Signa…
Sandbox: BaseConstraintToolMode — two-stage constraint creation with IToolActionEvents
BaseConstraintToolMode — Two-Stage Constraint Creation Pattern is the base for all two-point constraint tools (Weld, Rope, BallSocket, Elastic, Hydraulic, NoCol…
Component.GetComponent, GetComponentInChildren, GetComponentInParent — FindMode and RequireComponent
Component.GetComponent, GetComponentInChildren, GetComponentInParent — FindMode Reference Components provide convenient lookup methods for finding other compone…
s&box RollermineNpc: Physics-driven NPC
RollermineNpc Class API Reference RollermineNpc is a physics-driven NPC that chases players, leaps at them, and bounces off dealing damage on contact. Implement…
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 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…
Prefabs: Reusable GameObjects with Runtime Spawning via Clone
A prefab is a GameObject that can be used in multiple places — across scenes or instantiated at runtime. Assets Prefabs are saved as PrefabFile assets. To creat…
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 …
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 …
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…
Your First Project - s&box Documentation
Your First Project Creating Game Objects In s&box, everything in your scene is a GameObject. GameObjects can have Components attached to them that provide funct…
Sandbox: Map entities — Door, Button, FuncMover, TriggerPush, TriggerTeleport
Sandbox Map Entities — Door, Button, FuncMover, TriggerPush, TriggerTeleport These components implement interactive map elements. They live in the namespace and…
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…
s&box Ownable: Ownership tracking component
Ownable Component API Reference Ownable is a Component that tracks which Connection (player) spawned a GameObject, enabling prop protection and ownership checks…