UIDecal Component - Render Razor UI as a Decal
A Render Component for s&box that allows you to project Razor UI onto surfaces as a Decal. Great for sticking UI onto rounded walls, curved surfaces, or any geo…
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…
Rendering entities — TextRenderer, LineRenderer, SpriteRenderer, TrailRenderer, and ModelRenderer
Rendering Entities — Text, Line, Sprite, and Trail Renderers s&box provides several lightweight renderer components for common visual needs that don't require a…
Working with Models and Rendering
Guide to displaying 3D models in s&box. ModelRenderer Component Loading Models SkinnedMeshRenderer (Animated Models) Dynamic Model Creation LODs (Level of Detai…
Particle Effect system — emitters, manual emission, and custom controllers
Particle Effect System s&box particles are CPU-simulated and fully programmable. A particle system is built from three component types on the same GameObject: (…
NPC Ragdoll Creation with Clothing Preservation
NPC Ragdoll Creation with Clothing Pattern for creating ragdolls from NPCs including clothing preservation and bone merging. Key APIs **** — copies model, mater…
VirtualGrid — efficiently rendering large scrollable lists in s&box UI
VirtualGrid — Efficiently Rendering Large Lists in UI is a s&box UI panel that virtualizes a large collection — only the visible cells are created in the DOM. S…
Sandbox: NPC system — Schedule, Task, and Layer architecture
NPC System — Schedule, Task, and Layer Architecture The Sandbox NPC system uses a layered architecture: Layers handle continuous behaviours (navigation, senses,…
WorldPanel and ScreenPanel — HUD overlays and 3D world-space UI with Razor PanelComponent
WorldPanel and ScreenPanel — UI in the World s&box UI uses (Razor) attached to either a (HUD overlay) or (3D world-space UI). The same component works with both…
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,…
BeamEffect — laser and energy beams between two points
BeamEffect — Laser and Energy Beams renders a beam between two points in the world. Use it for lasers, electricity, tractor beams, or any line-based visual effe…
EnvmapProbe — local reflection captures with Static, Dynamic, and OnDemand modes
EnvmapProbe — Reflection Captures in s&box is a built-in s&box component that captures a cubemap at its world position for local specular reflections. The engin…
Custom editor tools — EditorTool, Gizmo drawing, scene tracing, and overlay UI
Custom Editor Tools Editor tools appear in the s&box toolbar and let you build scene editing workflows — painting, placement, custom gizmos. They must live in a…
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…
VerletRope — rope physics with attachment, slack, and stiffness
VerletRope simulates rope physics using Verlet integration. The rope hangs from the GameObject's position and optionally attaches its end to another GameObject.…
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…
Razor Panel Structure and Syntax
Razor Panel Structure s&box uses Razor syntax for UI panels with files and optional stylesheets. Basic Panel Component File Structure The Element The element is…
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
Noclip MoveMode with Collision Toggle
Noclip MoveMode Implementation Custom movement mode for noclip/fly behavior with collision toggle. Key Patterns MoveMode inheritance — override , , priority — 1…
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…