auto_stories

s&box MCP Knowledgebase

Documentation, API references, code examples and community knowledge for s&box development.

library_books 595 entries menu_book 352 Documentation code 133 API Reference terminal 100 Code Example groups 10 Community
Results for "components" in terminalCode Example 77 results closeClear
terminalCode Example
May 11, 2026

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…

terminalCode Example
May 20, 2026

Code Cheat Sheet: Quick Reference for GameObjects, Components, and Transforms

Quick reference for common s&box operations covering debugging, transforms, GameObjects, and Components. Useful when you know what you want to do but not the ex…

terminalCode Example
May 10, 2026

s&box JSONObject Save Data Helper for Components

This s&box-focused sample shows how to programmatically construct and deconstruct JSON for component save data. It is useful for player saves, world unlock stat…

terminalCode Example
May 3, 2026

Ownable Component Pattern for Prop Ownership

Ownable Component - Prop Ownership and Permission System A component that tracks which player spawned an object and enforces ownership-based permissions. Useful…

terminalCode Example
May 10, 2026

Extensible Player Data Save Hooks for World Components

This pattern lets gameplay components plug into a player's save/load flow without putting every feature directly inside one large class. The framework has three…

terminalCode Example
May 18, 2026

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…

terminalCode Example
May 10, 2026

Reusable World-Space Interaction Prompt Framework

A small, compartmentalized interaction framework can be built from three pieces: : the base component placed on objects the player can use. : the player-side ra…

terminalCode Example
May 12, 2026

ControlSystem: Vehicle seat control with IPlayerControllable

ControlSystem: Vehicle Seat Control with IPlayerControllable This example shows the ControlSystem which manages vehicle seat control, sorting seats by occupatio…

terminalCode Example
May 3, 2026

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 …

terminalCode Example
May 4, 2026

Sandbox: Ownable component — prop protection with IPhysgunEvent and IToolgunEvent

Ownable Component — Prop Protection and Physgun/Toolgun Access Control The component tracks which spawned a . It implements and to enforce ownership checks when…

terminalCode Example
May 10, 2026

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 …

terminalCode Example
May 4, 2026

Sandbox: ControlSystem — vehicle seat and contraption control with IPlayerControllable

ControlSystem — Vehicle Seat and Contraption Control is a that drives components on contraptions. When a player sits in a , the system walks the connected contr…

terminalCode Example
May 5, 2026

RadiusDamage — explosion area damage with IDamageable, occlusion, and physics force

RadiusDamage Component is a built-in s&box component that applies damage to all objects within a sphere. It integrates with the system and can apply outward phy…

terminalCode Example
May 5, 2026

SpawnPoint and TriggerHurt — spawn locations and damage trigger volumes

SpawnPoint and TriggerHurt in s&box SpawnPoint is a built-in s&box component that marks a world location for player or NPC spawning. uses to find valid spawn lo…

terminalCode Example
May 5, 2026

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: (…

terminalCode Example
May 5, 2026

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…

terminalCode Example
May 5, 2026

Decal component — projecting bullet holes, scorch marks, and surface details

Decal Component — Projecting Surface Marks projects a texture onto surfaces in the world. Use it for bullet holes, blood splats, scorch marks, graffiti, and any…

terminalCode Example
May 3, 2026

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

terminalCode Example
May 5, 2026

Async tasks in s&box — coroutines, parallel tasks, and frame-by-frame animation

Async Tasks in s&box Components s&box async tasks run on the main thread — they behave like coroutines. Use to yield one frame, to wait, and to run tasks in par…

terminalCode Example
May 5, 2026

Unit tests in s&box — MSTest setup, engine initialization, and component testing

Unit Tests in s&box s&box supports MSTest-based unit tests. Create a directory in your project folder and restart the editor — a test project is generated autom…