Project Structure Recommendations
Project Structure Recommendations Community guide for organizing s&box projects based on Facepunch examples and successful community projects. Recommended Folde…
Razor Panel Structure and Syntax
Razor Panel Structure s&box uses Razor syntax for UI panels with files and optional stylesheets. Basic Panel Component File Structure The Element The element is…
Libraries
Libraries Create reusable, shareable code and asset libraries. Structure Libraries live in folder: How It Works Game code references all installed libraries Lib…
Multiplayer Authority Patterns
Multiplayer Authority Patterns Community guide for structuring multiplayer code based on official networking documentation and proven patterns. Host-Authoritati…
Shaders in s&box - HLSL and Shading Models
Shaders in s&box - HLSL and Shading Models Write custom shaders in HLSL with Source 2's shading models, render states, and GPU instancing support. Shader Develo…
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: Duplicator tool — copy, paste, and save contraptions with DuplicationData
Duplicator Tool — Copy, Paste, and Save Contraptions The Duplicator tool copies a contraption (a connected graph of GameObjects) to JSON and pastes it back. It …
Sandbox: Weld tool — FixedJoint constraint with EasyMode rotation
Sandbox Weld Tool — Constraint Creation with EasyMode Rotation The Weld tool creates constraints between two GameObjects. It has an EasyMode that lets the playe…
Connection Permissions - s&box Networking Documentation
Connection Permissions Connection permissions control what clients can do in your multiplayer game. Set permissions for spawning objects, using tools, or perfor…
Custom Snapshot Data - s&box Networking Documentation
Custom Snapshot Data For advanced networking, you can write and read custom data in network snapshots. This allows efficient synchronization of complex game sta…
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…
GameObject.Network Accessor — IsProxy, IsOwner, TakeOwnership, DropOwnership, Refresh, and IGameObjectNetworkEvents
GameObject.Network Accessor — Ownership, Spawning, and Proxy Detection is a that provides all network-related operations for a . It always resolves to the netwo…
s&box Vector3 extension for aim cone randomization
s&box Vector3 Extension for Aim Cone Randomization This example shows extension methods for adding random spread to Vector3 direction vectors using s&box's Game…
Component Versioning: JsonUpgrader for Breaking Property Changes in s&box
s&box Component Versioning lets you define upgraders for breaking changes like property renames or data structure changes. Upgrades are chained — if a component…
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…
NetworkSpawn, Ownership Transfer, and Network.Refresh in s&box
NetworkSpawn and Ownership Transfer in s&box Spawning a Networked Object Ownership Transfer Modes (OwnerTransfer) Taking and Dropping Ownership Checking Ownersh…
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 …