Libraries - s&box Code Documentation
Libraries Libraries are reusable code packages you can share between projects or distribute to others. They provide a way to modularize your code and avoid dupl…
Network Events: INetworkListener and INetworkSpawn Interfaces
React to players joining and leaving by implementing or on a component in the scene. INetworkListener Example Spawn a player object when someone joins: INetwork…
IScenePhysicsEvents: Pre and Post Physics Step Hooks
lets Components or GameObjectSystems wrap logic around the physics step. Implement it when you have systems that work closely with physics and need to run code …
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…
Camera and View Control
Working with cameras and player viewpoints in s&box. Main Camera Access Creating a Player Camera First-Person Camera Screen to World Ray World to Screen Camera …
GameObjectSystem: Scene-Level Batch Processing Systems in s&box
A in s&box is a scene-level system that performs work at specific points during the frame. Automatically instantiated when a scene is created — no manual setup …
Particle Effect - s&box Documentation
Official s&box documentation for Particle Effects - visual effects system. Particle Effect creates visual effects using GPU-accelerated particles. The system su…
GameObject: Transform, Tags, Children, and Components
A represents an object in the scene world. It contains a Transform, Tags, Children, and Components. Transform Represents where the GameObject is in the scene — …
Rigidbody Physics
The component enables physics simulation on GameObjects. Basic Usage Rigidbody Properties Forces Collision Detection Wake/Sleep Spawn with Velocity
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…
Prefab Templates: Adding Custom Prefabs to the s&box Create Menu
s&box Prefab Templates let you add custom prefabs to the GameObject Create menu in the scene editor. Setup Enable "Show In Menu" on a Prefab File in the inspect…
Raw Input: Direct Keyboard Access Bypassing Input Actions
s&box provides raw keyboard input access that bypasses input actions. Only use this when input actions won't work — raw inputs cannot be rebound by players. Ava…
Dedicated Servers: Running Local Projects with Hidden Serverside Code
s&box dedicated servers can run entirely local projects as the game using the command line argument: Assets are still fetched from the cloud version of the game…
Custom Editors
Custom Editors Create custom editor widgets for your classes, structs, and assets. ControlWidget (Property Editor) Create custom property editors using : Attrib…
Binary Serialization: BlobData for Large GameResource Data Storage
When JSON files grow too large in s&box, you can store data as a binary blob using the class. This works with GameResource assets and provides custom serializat…
Player Component with Static Accessors
Player Component Main player component that manages health, damage, camera, and interfaces with the inventory system. Static Accessors Key Properties HUD Visibi…
Project Structure Recommendations
Project Structure Recommendations Community guide for organizing s&box projects based on Facepunch examples and successful community projects. Recommended Folde…
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…
Multiplayer Authority Patterns
Multiplayer Authority Patterns Community guide for structuring multiplayer code based on official networking documentation and proven patterns. Host-Authoritati…
Sandbox: Ownable component — prop protection with IPhysgunEvent and IToolgunEvent
Ownable Component — Prop Protection and Physgun/Toolgun Access Control The component tracks which spawned a . It implements and to enforce ownership checks when…