s&box achievement unlocking with Rpc.FilterInclude targeting
s&box Achievement Unlocking with Rpc.FilterInclude This example shows achievement unlocking using s&box's Services.Achievements, Services.Stats, and Rpc.FilterI…
Moving a SceneObject with Transform in s&box
Use to move a SceneObject each frame in s&box. This moves the object forward at 100 units per second. Prefer over direct manipulation of the SceneObject for net…
Controller Input
Handle gamepad/controller input in s&box. Detecting Controllers Analog Inputs Auto-Mapped Input Haptics/Rumble Motion Controls Local Multiplayer
Playing Sounds
Playing Sounds in s&box s&box provides both 2D and 3D sound playback through code and components. Quick Sound Playback Sound Handle Store the handle to control …
Chat UI Pattern with RPC Broadcasting
Chat UI with RPC Broadcasting A Razor UI component for game chat that handles local input, RPC broadcasting, Steam filtering, and automatic message expiration. …
Multiplayer and Networking
Complete guide to multiplayer setup in s&box. Creating a Lobby Joining a Lobby Spawning Networked Players Host/Client Checks Connection Events Networked Object …
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…
PlayerInventory Weapon Switching
PlayerInventory Weapon Switching Weapon switching with host authority and IPlayerEvents delegation. Key Features Sync'd ActiveWeapon with Change callback for ne…
Randomized Clothing for NPC Citizens using Dresser.Randomize() on Prefabs
Overview This demonstrates how to create NPC citizen prefabs with randomized clothing using the built-in component. Each time the prefab spawns or is enabled, i…
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
Input Handling Code Examples
Input Handling Code Examples Comprehensive input examples covering buttons, analog sticks, mouse, controller, and VR input. Default Input Actions
Sandbox: ToolMode system — creating custom Tool Gun modes
ToolMode System — Creating Custom Tool Gun Modes is the base class for all Tool Gun tools in Sandbox. Tools are components on the Toolgun and are enabled/disabl…
Sandbox: ISpawner interface — custom spawner pattern with ISpawnEvents
ISpawner Interface — Custom Spawner Pattern The interface defines the contract for anything that can be spawned via the spawn menu. Implementations include , , …
NavMeshLink custom traversal — parabolic jump, ladder climb, and physics jump
NavMeshLink Custom Traversal connects two NavMesh points for agents to traverse (jumps, ladders, teleports). Default traversal linearly interpolates between sta…
Physics joints — Fixed, Ball, Hinge, Slider, Spring, and Wheel
Physics Joints Joints connect two physics bodies together with constraints. All joint types are components added to a GameObject positioned at the joint's ancho…
Scene lighting setup — DirectionalLight, PointLight, SpotLight, SkyBox, AmbientLight, and Fog
Scene Lighting Setup s&box lighting is built from components. A typical scene needs a directional light (sun), ambient light, and a skybox. Directional Light (S…
Spatial audio components — SoundPoint, SoundBox, SoundscapeTrigger, DspVolume, and AudioListener
Spatial Audio Components s&box provides several components for placing audio in the world. All are alternatives to for persistent, positioned audio sources. Sou…
Post-processing and camera setup — CameraComponent, PostProcessVolume, Bloom, DoF, and Film Grain
Post-Processing and Camera Setup CameraComponent Orthographic Camera Multiple Cameras (Priority) Higher priority renders on top. Use for split-screen, minimaps,…
Component Event Interfaces for Tool Interactions
Component Event Interfaces (IPhysgunEvent, IToolgunEvent) Event interfaces that allow components to respond to tool interactions. These use s&box's pattern for …
s&box context menu with submenus and auto-positioning
s&box Context Menu with Submenus and Auto-Positioning This example shows a context menu system using s&box's Panel, Screen, and layout system with submenu build…