Controller Input
Handle gamepad/controller input in s&box. Detecting Controllers Analog Inputs Auto-Mapped Input Haptics/Rumble Motion Controls Local Multiplayer
Console Variables and Commands: ConVar and ConCmd with Flags
Console variables () and commands () let you create tweakable settings and runnable commands accessible from the s&box console. Console Commands Static methods …
WorldPanel and ScreenPanel — HUD overlays and 3D world-space UI with Razor PanelComponent
WorldPanel and ScreenPanel — UI in the World s&box UI uses (Razor) attached to either a (HUD overlay) or (3D world-space UI). The same component works with both…
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…
Sandbox: PlayerInventory — weapon slots, pickup, drop, and loadout persistence
Sandbox PlayerInventory — Weapon Slots, Pickup, Drop, and Loadout Persistence manages up to 6 weapon slots, handles pickup/drop logic, and delegates loadout sav…
s&box Game Static Class: Core Game State and Operations
s&box Game Static Class: Core Game State and Operations The static class provides global access to core game state, utilities, and operations. Scene Management …
SceneTraceResult: All Fields and Properties from Trace Hits
is returned by and contains all information about a trace hit. Key Fields Common Usage Pattern
Sandbox: SaveSystem — scene diff save/load with versioning and ISaveEvents
Sandbox SaveSystem — Scene Diff Save/Load The captures the difference between the current scene state and the original scene file. This means saves are compact …
Common Pitfalls and How to Avoid Them
s&box Common Pitfalls and How to Avoid Them Community-compiled list of frequently encountered issues and their solutions, based on Discord support channels and …
Sandbox: BaseWeapon — ammo system, reload, shoot delay, and IPlayerControllable
BaseWeapon — Ammo, Reloading, and Firing Pattern extends and adds ammo management, reloading, and a shoot delay system. It implements so it can also be used fro…
GameObjectSystem with [Sync] and RPCs: Networked Scene-Level State
GameObjectSystem with [Sync]: Networked Scene-Level State supports properties just like components. However, there is a key difference: all properties on a are …
s&box SoundDefinition: Categorized sound GameResource
SoundDefinition GameResource API Reference SoundDefinition is a GameResource that defines a categorized sound for use on spawned entities (thrusters, hoverballs…
s&box SnapGrid: World-space snap grid overlay
SnapGrid: World-Space Snap Grid Overlay SnapGrid is a sealed class that manages a world-space snap grid overlay projected onto a surface plane. It is used by th…
Custom GameResource assets — defining asset types with ResourceLibrary and PostLoad registry
Custom GameResource Assets lets you define your own asset types with a custom file extension, inspector UI, and hot-reload support. Assets are JSON files under …
s&box SaveSystem: Scene save/load with metadata and event hooks
SaveSystem API Reference SaveSystem is a GameObjectSystem that captures differences between the current scene state and the original scene, enabling save/load f…
Project Structure Recommendations
Project Structure Recommendations Community guide for organizing s&box projects based on Facepunch examples and successful community projects. Recommended Folde…
Sandbox.Json
Sandbox.Json JSON serialization utilities. Overview Json provides methods for serializing objects to JSON and parsing JSON strings. Serialize Deserialize Parse …
Scene Metadata - s&box Scene Documentation
Scene Metadata You can implement the interface in any Component that has data you'd like saved to Metadata. Metadata is data that can be accessed without needin…
Sandbox: UndoSystem — per-player undo stack with bounded history (128 steps)
UndoSystem — Per-Player Undo Stack The is a that maintains a per-player undo stack. Each entry holds a set of s that get destroyed when the undo is triggered. U…
ModelRenderer Material Overrides: MaterialOverride, SetMaterialOverride by Tag, Per-Index Materials Accessor, and Attachments
ModelRenderer Material Overrides: MaterialOverride, SetMaterialOverride, and Materials Accessor provides several ways to override materials on a model. Global M…