s&box DroppedWeapon: Weapon pickup
DroppedWeapon Component API Reference DroppedWeapon handles weapon pickup when a weapon is dropped in the world. Implements IPressable for interaction and Playe…
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…
PlayerInventory Weapon Switching
PlayerInventory Weapon Switching Weapon switching with host authority and IPlayerEvents delegation. Key Features Sync'd ActiveWeapon with Change callback for ne…
BaseWeapon and BaseCarryable Weapon Framework
BaseWeapon and BaseCarryable - Weapon Framework Base classes for creating weapons in s&box. Provides ammo management, view/world models, and input handling. Bas…
Inventory Hotbar UI Component
Inventory HUD with Hotbar A Razor PanelComponent that displays player inventory slots as a hotbar with mouse wheel and number key support. Implementation Key Fe…
Slot-based inventory UI with BuildHash optimization
Slot-Based Inventory UI with BuildHash Optimization This example shows a slot-based inventory UI with BuildHash() optimization to prevent unnecessary rebuilds a…
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…
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…
s&box WeaponConVars: Global weapon settings
WeaponConVars Static Class WeaponConVars is a static class that defines console variables controlling global weapon behavior in s&box. These ConVars can be set …
Sandbox.GameResource
Sandbox.GameResource Base class for custom asset types. Overview GameResource is the base class for creating custom asset types that appear in the editor with f…
s&box AmmoResource: Shared ammo type GameResource
AmmoResource GameResource API Reference AmmoResource is a GameResource that defines a type of ammo that can be shared across weapons. Weapons that reference the…
Project Structure Recommendations
Project Structure Recommendations Community guide for organizing s&box projects based on Facepunch examples and successful community projects. Recommended Folde…
Player Event Interfaces (Local and Global)
Local.IPlayerEvents and Global.IPlayerEvents Event interfaces for player lifecycle, damage, inventory, and camera events. Local fires to player hierarchy only; …
Physics Tracing Code Examples
Physics Tracing Code Examples Raycast and shape trace examples using — the builder pattern for physics queries. TraceResult Properties Builder Pattern Methods
Sandbox: Full codebase architecture — systems, player components, weapons, tools, NPCs
Sandbox Codebase Architecture Overview The Facepunch Sandbox game is a large reference implementation. Here's a map of the major systems and how they connect. C…
s&box CombatNpc: Combat NPC
CombatNpc Class API Reference CombatNpc is a combat NPC that searches for players, advances on them, fires in bursts, and repositions. When friendly, follows pl…
GameManager.Spawn RPC with Ident Parsing
GameManager.Spawn RPC Broadcast RPC for spawning entities from string identifiers with automatic weapon pickup detection. Ident Format - Spawn a prop from asset…
s&box GamePreferences: User preferences
GamePreferences Static Class GamePreferences is a static class that defines the local user's preferences for the game. These ConVars control player-specific set…
s&box DamageInfo: Extensible Damage Data Class and IDamageable Interface
s&box DamageInfo: Extensible Damage Data Class is a class (not a struct) so it can be subclassed for game-specific damage types. Definition Usage IDamageable In…
TraceAttackInfo record struct
TraceAttackInfo Record Struct Information about a trace-based attack in s&box, used to pass attack data through the weapon system. Properties Target () - The Ga…