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…
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…
Joint Components: HingeJoint Motor Modes, BreakForce, Body Resolution, and Joint Creation Timing
Joint Components: HingeJoint, FixedJoint, and the Joint Base Class s&box provides physics joint components for constraining physics bodies. All joints extend th…
Drag-and-drop system with static instance pattern
Drag-and-Drop System with Static Instance Pattern This example shows a drag-and-drop system using a static instance pattern for global state management and visu…
s&box SelfCollisionSound: Single-surface collision sounds
SelfCollisionSound Component API Reference SelfCollisionSound is a Component that plays collision sounds only from this object's surface, preventing duplicate s…
s&box TaskBase: NPC task base class
Abstract base class for NPC tasks. Tasks are executed as part of a Schedule and return a TaskStatus to indicate their state. Properties Methods TaskStatus Enum …
Razor Panels: HTML/CSS UI with C# in s&box
s&box UI can be created using Razor syntax — web-like HTML/CSS combined with C#. Panels are not rendered via a HTML renderer; the syntax is a convenience layer …
WebSocket Connections with Auth Token Authentication in s&box
s&box supports WebSocket connections to external servers for custom networking or persistent data outside the local filesystem. Basic Connection and Messaging U…
Component Execution Order: Lifecycle Flow and GameObjectSystem Ordering
s&box component execution order determines when lifecycle methods are called. You should not rely on the order in which the same callback gets invoked for diffe…
WebSockets: External Server Communication with Auth Token Support
s&box allows WebSocket connections to interface with external servers. Common uses include custom networking and persistent data storage outside the local files…
Component Lifecycle Methods Reference
Component Lifecycle Methods s&box Components have a well-defined lifecycle with specific methods you can override for different phases of initialization and upd…
Razor Panels: HTML/CSS UI with C# in s&box PanelComponent System
s&box Razor Panels use web-like HTML/CSS syntax with C# for UI creation. Panels are rendered natively (not via HTML renderer) — the syntax is a convenience laye…
Code Basics - s&box Documentation
Code Basics C# is the primary programming language for s&box. The engine uses modern .NET with hotloading support, allowing you to see code changes instantly wi…
Rigidbody Physics
The component enables physics simulation on GameObjects. Basic Usage Rigidbody Properties Forces Collision Detection Wake/Sleep Spawn with Velocity
ToolMode Base Class for Toolgun Modes
ToolMode Base Class Abstract base class for creating toolgun modes in s&box. Handles input registration, action dispatch, and HUD rendering. Class Overview Acti…
Sandbox: ToolMode system — creating custom Tool Gun modes
ToolMode System — Creating Custom Tool Gun Modes is the base class for all Tool Gun tools in Sandbox. Tools are components on the Toolgun and are enabled/disabl…
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,…
Physics joints — Fixed, Ball, Hinge, Slider, Spring, and Wheel
Physics Joints Joints connect two physics bodies together with constraints. All joint types are components added to a GameObject positioned at the joint's ancho…
VerletRope — rope physics with attachment, slack, and stiffness
VerletRope simulates rope physics using Verlet integration. The rope hangs from the GameObject's position and optionally attaches its end to another GameObject.…
WebSockets
Use WebSockets for real-time communication with external servers. Basic Setup With Auth Token Common Use Cases Custom networking — External matchmaking, chat se…