Sandbox.Angles
Sandbox.Angles Euler angles (yaw, pitch, roll) representation. Overview Angles stores rotation as yaw, pitch, and roll in degrees — easier to work with than qua…
Sandbox.Rotation
Sandbox.Rotation Represents 3D orientation. Overview Rotation stores an orientation in 3D space, handling quaternion math internally. Creation Constants Applyin…
Math types — Vector3, Rotation, Angles, Transform, TimeSince, and BBox
Math Types — Vector3, Rotation, Angles, and Transform s&box uses its own math types. Here's a practical reference for the ones you'll use constantly. Vector3 Ro…
BulletConfiguration record struct
BulletConfiguration Record Struct Configuration for s&box bullet weapon behavior including damage, spread, and recoil. Properties Damage () - Base damage per bu…
s&box Vector3.WithAimCone: Direction spread
Vector3.WithAimCone Extension Method The WithAimCone extension method adds random spread to a direction vector, useful for bullet spread, projectile dispersion,…
Sandbox: BaseBulletWeapon — hitscan shooting with BulletConfiguration, recoil, and IronSightsWeapon
BaseBulletWeapon — Hitscan Shooting with Recoil and Camera Noise extends and implements hitscan bullet firing with configurable aim cone, recoil, and camera noi…
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 …
Input Handling Code Examples
Input Handling Code Examples Comprehensive input examples covering buttons, analog sticks, mouse, controller, and VR input. Default Input Actions
Math Types: Vector3, Rotation, Angles, and Transform
s&box provides several math types for 3D game development in the namespace. Vectors Vector2 — 2D (x, y) for screen/UI Vector3 — 3D (x, y, z) for world positions…
Math Types - s&box Documentation
Official s&box documentation for Math Types including Vector3, Rotation, Angles, and related types. Vector3 represents 3D positions and directions with X, Y, Z …
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…
s&box EnvironmentShake: Camera shake component
Component that creates camera shake effects based on distance and time curves. Implements ICameraSetup to apply rotation noise during PostSetup. Properties Prop…
PlayerController: Physics-Based Character with Events Interface
The component is a physics-based first/third person player controller. Add it to a scene and be running around with no programming required. Core Features Physi…
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…