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…
Rpc.FilterInclude for targeted RPC broadcasting
Rpc.FilterInclude for Targeted RPC Broadcasting Rpc.FilterInclude is a using statement in s&box that restricts RPC broadcasts to specific connections only. This…
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 …
s&box achievement unlocking with Rpc.FilterInclude targeting
s&box Achievement Unlocking with Rpc.FilterInclude This example shows achievement unlocking using s&box's Services.Achievements, Services.Stats, and Rpc.FilterI…
RealTime vs Time: Wall-Clock vs Scene Time — RealTimeSince, RealTimeUntil, GlobalNow, and SmoothDelta
RealTime vs Time: Wall-Clock vs Scene Time — When to Use Each s&box has two time systems. Choosing the wrong one is a common source of bugs. Time (Scene Time) ,…
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…
s&box player management with RPC, ConCmd, and Connection APIs
s&box Player Management with RPC, ConCmd, and Connection APIs This example shows player kick/ban utilities using s&box's Connection, RPC, ConCmd, and Chat syste…
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…
RPC Attributes: Rpc.Broadcast, Rpc.Host, Rpc.Owner — Targeting, NetFlags, and Rpc.FilterInclude/Exclude
RPC Attributes: Rpc.Broadcast, Rpc.Host, Rpc.Owner — Targeting and Flags s&box RPCs are declared with nested attributes on the static class. The old top-level a…
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…
s&box Sandbox Security Model: Assembly Whitelist, Blocked APIs, Reflection Restrictions, and Safe Assembly Caching
s&box Sandbox Security Model: Assembly Access Control and Whitelisted APIs s&box uses a whitelist-based security model to prevent game code from accessing dange…
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…
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…
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 …
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…
Component execution order — OnAwake, OnStart, OnUpdate, OnFixedUpdate, and OnLateUpdate
Component Execution Order s&box calls component lifecycle methods in a defined order each frame. Understanding this order is essential for avoiding race conditi…
Unit tests in s&box — MSTest setup, engine initialization, and component testing
Unit Tests in s&box s&box supports MSTest-based unit tests. Create a directory in your project folder and restart the editor — a test project is generated autom…
LocalData persistence for server-side data
LocalData Persistence in s&box LocalData provides server-side data persistence that survives server restarts. It's useful for storing configuration, ban lists, …
Common s&box component gotchas — physics, networking, scene, and rendering pitfalls
Common s&box Component Gotchas Practical pitfalls that catch most new s&box developers. Physics Rigidbody + CharacterController on the same GO — don't do it. Th…