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…
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; …
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…
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…
Sandbox: Physgun — grab, freeze, launch, and pull mechanics
Physgun — Grab, Freeze, Launch, and Pull Mechanics The Physgun () is a that lets players grab, move, freeze, and launch physics objects. It uses a struct to tra…
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…
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…
s&box ScriptedEmitter: Particle emitter GameResource
ScriptedEmitter GameResource API Reference ScriptedEmitter is a GameResource that defines a particle/VFX emitter with a prefab, used for spawning visual effects…
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…
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…
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…
Physgun Grab State with Permission Checks
Physgun Grab State Pattern Implementation pattern for physgun object grabbing with ownership checks and IPhysgunEvent permissions. Key Features Sync'd GrabState…
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…
s&box BaseCarryable.IEvent: World model events
BaseCarryable.IEvent Interface API Reference BaseCarryable.IEvent is an interface for receiving world model lifecycle events on carryable objects (weapons, item…
BaseCarryable.IEvent interface
BaseCarryable.IEvent Interface Scene event interface for world model lifecycle events on s&box carryable items. Methods OnCreateWorldModel Called when the world…
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…