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…
Libraries
Libraries Create reusable, shareable code and asset libraries. Structure Libraries live in folder: How It Works Game code references all installed libraries Lib…
Libraries: Reusable Code Packages with Source Sharing
s&box Libraries are self-contained code and asset packages stored in your project's folder. They enable code reuse across multiple projects and can be shared wi…
Code Generation - s&box Documentation
Official s&box documentation for Code Generation - compile-time code generation. Code Generation covers the source generator system in s&box. The generator crea…
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…
Serverside Code: #if SERVER Blocks and .Server.cs Files for Hidden Logic
s&box supports serverside-only code that is stripped from client builds. This only works when running local projects on dedicated servers. #if SERVER Blocks Cod…
s&box Cheat Sheet
s&box Cheat Sheet Quick reference for common s&box operations. Debugging Transforms GameObjects Components Input Networking
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…
ActionGraph - Visual Scripting System
ActionGraph - Visual Scripting System Create game logic using node-based visual scripting without writing code. Overview ActionGraph lets you: Build gameplay lo…
Testing Multiplayer: New Instances, Hotloading, and Local Connect
s&box provides built-in tools for testing multiplayer without needing another player. You can spawn additional game instances that join your running session, wi…
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 …
Testing Multiplayer - s&box Networking Documentation
Testing Multiplayer s&box provides tools for testing multiplayer locally without needing multiple computers or Steam accounts. New Instance Launch a second game…
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…
Cheat Sheet: Quick Reference for s&box GameObjects, Components, and Debugging
Quick reference for common s&box operations across debugging, transforms, GameObjects, and Components. Debugging Transforms GameObjects Components
Exporting Standalone - s&box Documentation
Exporting Standalone ⚠️ Warning: Exporting standalone games is currently in preview. Distribution requires approval from Valve — we're working with them to open…
API Whitelist: Sandboxed Code Restrictions and Safe Alternatives
s&box uses a code whitelist to prevent access to classes and functions that could be used maliciously. Code that doesn't pass these checks will not be loaded in…
Standalone Code: Full .NET Access and STANDALONE Constant for Exported Games
When s&box games are exported as standalone builds, they run outside the platform with additional capabilities not available in platform games. STANDALONE Const…
Getting Started - s&box Documentation
Getting Started S&box is coded in C#. Under the hood, it uses the Source 2 engine (CS2, HL:Alyx, DOTA2) and some of its systems: rendering, resources, physics, …
s&box Hotload System: How Code Reloading Works, SkipHotload, ConVar Persistence, and NetworkObject.OnHotload
s&box Hotload System: How Code Reloading Works s&box supports live code reloading (hotload) without restarting the game. Understanding how it works helps avoid …
Styling Panels: SCSS, Inline Styles, and Code-Based Styling
s&box panels can be styled using SCSS stylesheets, inline styles, style blocks, or direct code manipulation. The styling system uses CSS-like syntax but is rend…