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 "gameobject" in terminalCode Example 49 results closeClear
terminalCode Example
May 12, 2026

UndoSystem: Per-player undo functionality

UndoSystem: Per-Player Undo Functionality This example shows the UndoSystem which provides per-player undo stacks for tracking spawned objects and allowing play…

terminalCode Example
May 12, 2026

GameObject.FindNetworkRoot() extension method

GameObject.FindNetworkRoot() Extension Method This example shows an extension method for finding the network root of a GameObject hierarchy. Usage Example Key F…

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 4, 2026

Sandbox: BaseConstraintToolMode — two-stage constraint creation with IToolActionEvents

BaseConstraintToolMode — Two-Stage Constraint Creation Pattern is the base for all two-point constraint tools (Weld, Rope, BallSocket, Elastic, Hydraulic, NoCol…

terminalCode Example
May 3, 2026

Prefab Spawning and Cloning

Prefab Spawning and Cloning Prefabs are reusable GameObject templates that can be instantiated at runtime. Creating Prefabs Create a GameObject in the scene wit…

terminalCode Example
May 4, 2026

Sandbox: UndoSystem — per-player undo stack with bounded history (128 steps)

UndoSystem — Per-Player Undo Stack The is a that maintains a per-player undo stack. Each entry holds a set of s that get destroyed when the undo is triggered. U…

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 4, 2026

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…

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 3, 2026

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…

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 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 3, 2026

CleanupSystem Pattern for Map Reset and Scene Management

CleanupSystem - Scene State Management and Map Cleanup A that captures the baseline scene state and allows resetting the map to its original state. Removes spaw…

terminalCode Example
May 12, 2026

IPlayerControllable example: ThrusterEntity

IPlayerControllable Example: ThrusterEntity ThrusterEntity demonstrates how to implement IPlayerControllable for a thruster that responds to player input while …

terminalCode Example
May 5, 2026

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.…

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 3, 2026

Camera and View Control

Working with cameras and player viewpoints in s&box. Main Camera Access Creating a Player Camera First-Person Camera Screen to World Ray World to Screen Camera …

terminalCode Example
May 4, 2026

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 , , …

terminalCode Example
May 3, 2026

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…

terminalCode Example
May 4, 2026

Sandbox: Duplicator tool — copy, paste, and save contraptions with DuplicationData

Duplicator Tool — Copy, Paste, and Save Contraptions The Duplicator tool copies a contraption (a connected graph of GameObjects) to JSON and pastes it back. It …