Clutter System: GPU-Instanced Scattering for Grass, Rocks, and Debris
The s&box Clutter System scatters large amounts of small objects (grass, rocks, debris) with GPU-instanced rendering. It handles placement, streaming, and LOD a…
Component Marker Interfaces: ExecuteInEditor, DontExecuteOnServer, IDamageable, INetworkSpawn, IPressable, INetworkVisible
Component Marker Interfaces: ExecuteInEditor, DontExecuteOnServer, IDamageable, INetworkSpawn, IPressable s&box uses marker interfaces nested inside the class t…
Sandbox.Log
Sandbox.Log Static logging class for console output. Overview Log messages appear in the editor console, in-game console (press ), and log files. Logging Method…
Libraries
Libraries Create reusable, shareable code and asset libraries. Structure Libraries live in folder: How It Works Game code references all installed libraries Lib…
SkinnedModelRenderer: Bone Merge, Animation Parameters, Sequences, Attachments, and Animation Events
SkinnedModelRenderer: Bone Merge, Animation Parameters, and Attachments extends for models with bones and animations. It integrates with the for threaded animat…
DynamiteEntity Explosive Entity Pattern
DynamiteEntity - Simple Explosive Entity A simple explosive entity that can be triggered via damage or player input. Demonstrates , , and prefab cloning pattern…
Mapping in s&box
Mapping in s&box s&box includes Hammer, the Source 2 level editor, for creating maps. Opening Hammer Main Menu → Tools → Hammer Or click Hammer icon in toolbar …
Game Resources - s&box Documentation
Official s&box documentation for Game Resources - custom asset types. GameResource allows defining custom asset types that can be created in the editor and load…
s&box SpriteRenderer: Billboard Modes, Animation Control, Broadcast Events, and Rendering Options
s&box SpriteRenderer: Animated Sprites, Billboard Modes, and Broadcast Events renders a asset in the s&box world with support for animation, billboarding, and f…
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…
Clutter System — scattering grass, rocks, and debris with GPU instancing
Clutter System — Scattering Grass, Rocks, and Debris The Clutter System scatters large amounts of small objects (grass, rocks, debris) across a scene using GPU-…
s&box Component Lifecycle: Exact Execution Order and Internal Guards
s&box Component Lifecycle: Exact Execution Order and Internal Guards Derived directly from and in the s&box engine source. Execution Order **** — Called once wh…
s&box ServerSettings: Server-controlled settings
ServerSettings Static Class ServerSettings is a static class that defines server-controlled settings replicated to all clients. These ConVars control game-wide …
Component Interfaces: IDamageable, ICollisionListener, ExecuteInEditor
s&box provides several built-in component interfaces for physics, damage, networking, and editor execution. ExecuteInEditor Runs component methods (OnAwake, OnE…
Debugging and Profiling Tips
Debugging and Profiling Tips Community guide for debugging s&box games based on official tools and developer recommendations. Console Commands Useful built-in c…
Undo System - s&box Editor Documentation
Undo System The undo system allows you to make editor actions reversible. Users can press Ctrl+Z to undo changes made by your tools. Scope Based Undo Create an …
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…
Hotloading - s&box Documentation
Hotloading Whenever you save a code file in your project (.cs or .razor files), we recompile and attempt to live-reload the changed assembly. This lets you quic…
Unit Tests - s&box Documentation
Official s&box documentation for Unit Tests - automated testing. Unit Tests covers writing and running tests for s&box code. Tests can verify component behavior…
GameObjectFlags: DontDestroyOnLoad, NotNetworked, Absolute, and Destroy vs DestroyImmediate
GameObjectFlags: Controlling GameObject Behavior is a flags enum that controls special behaviors for GameObjects. Values Usage ```csharp // Survive scene loads …