Trigger-Based Background Music Crossfade Framework
This pattern replaces area music with a small local-client music framework. Each zone requests a target , while one controller crossfades the currently playing …
Building a Networked Radio System with 3D Audio and Sync
Building a functional, interactive, and multiplayer-compatible radio system in s&box requires coordinating networked replication, local 3D audio handles, extern…
Playing Sounds: SoundEvent, SoundHandle, and GameObject Audio in s&box
s&box provides several ways to play sounds in code: fire-and-forget at a world position, control via SoundHandle, attach to a GameObject, or use scene component…
s&box SpeechLayer: NPC speech and subtitles
NPC behavior layer that manages speech state, plays sound files, and renders subtitle text above the NPC's head. Properties Methods Behavior Resolves a random s…
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…
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 …
Sound.Play and SoundHandle: 3D Audio, Volume, Pitch, Occlusion, UI Sounds, and Dedicated Server Behavior
Sound.Play and SoundHandle: Audio Playback in s&box is the static entry point for audio playback. is the returned handle for controlling a playing sound. Playin…
Door Component with IPressable Interface
Door Component with IPressable Map entity door with animated open/close using curves and the IPressable interface. Key Features AnimationCurve for smooth motion…
s&box PlayerFallDamage: Fall damage component
PlayerFallDamage Component API Reference PlayerFallDamage is a Component that applies fall damage to the player when they land. It implements Local.IPlayerEvent…
s&box RollermineNpc: Physics-driven NPC
RollermineNpc Class API Reference RollermineNpc is a physics-driven NPC that chases players, leaps at them, and bounces off dealing damage on contact. Implement…
Playing Sounds: SoundHandle, GameObject.PlaySound, and Audio Components
s&box provides several ways to play sounds: fire-and-forget at a position, controlled via , attached to a , or via scene components. SoundEvent Assets Sounds ar…
s&box BasePickup: Trigger and collision-based pickup system
BasePickup API Reference BasePickup is an abstract Component for creating trigger or collision-based pickups (weapons, ammo, items). Type Signature Required Com…
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 IResourcePreview: Resource preview interface
IResourcePreview Interface API Reference IResourcePreview is an interface for GameResources that want to enable in-picker previewing. When the user clicks an it…
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…
Playing Sounds - s&box Sound Documentation
Playing Sounds s&box provides multiple ways to play audio. From simple one-shots to complex 3D spatial audio with full control. SoundEvent Create reusable sound…
ReloadSoundEntry record struct
ReloadSoundEntry Record Struct Defines a timed sound event to play during s&box weapon reload animations. Properties Time () - Seconds after reload starts to pl…
Project Structure Recommendations
Project Structure Recommendations Community guide for organizing s&box projects based on Facepunch examples and successful community projects. Recommended Folde…
s&box BasePickup: Pickup item base
BasePickup Abstract Class API Reference BasePickup is an abstract Component for items that can be picked up by players. Implements ITriggerListener and ICollisi…
BasePickup with ITriggerListener and ICollisionListener
BasePickup Abstract Class Abstract base for item pickups using trigger and collision detection with host-only consumption. Key Patterns **** — trigger volume pi…