s&box/field-guide
 field-guide / search

97 results · flexsearch

@ref on a bare private field silently never assigns

@ref on a private field compiles with only a CS0649 warning — the ref stays null at runtime. Bind to a property instead.

building-ui · ✓ 26.07
A complete Blender-headless → s&box pipeline

Two-stage flow: Blender headless emits Y-up OBJ, then pure Python writes vmats/vmdls and a C# model catalog.

getting-art-in · ✓ 26.07
A frame-budget method for stylized s&box scenes

Census tris × instances before decimating; prefer BoxCollider over ModelCollider for decorative props.

making-it-perform · ✓ 26.07
A pre-publish checklist for sbox.game

Org/ident rules, every store-page field is launch-blocking, AI thumbnails demoted — verify as a player after publish.

publishing-shipping · ✓ 26.07
Agent workflow: file-ownership and plan-review-delegate

Disjoint file ownership, serialize hot files, report-don't-fix foreign errors, resume after interrupts — the concurrency rules that keep agent waves shippable.

ai-assisted-workflow · ✓ 26.07
Angles struct fields are lowercase

Angles uses .pitch/.yaw/.roll (lowercase) and Vector3 uses .x/.y/.z — capitalized sightings in a codebase belong to unrelated component properties.

tooling-environment · ✓ 26.07
Assembly.cs global usings as project bootstrap

global using Sandbox + your razor namespace in Assembly.cs — without it, panels and game types don't resolve across the assembly.

getting-set-up · ✓ 26.07
Authoring s&box .sound events by hand

MP3 + JSON .sound beside it — no wav/ffmpeg; Distance is in inches; copy schema from addons/menu box_open.sound.

audio · ✓ 26.07
Blender OBJ export face order is not deterministic

bpy.ops.wm.obj_export can reorder face lines across runs on the same mesh — diff the manifest, not the raw OBJ bytes.

getting-art-in · ✓ 26.07
Building a draggable slider with click-to-jump and drag-to-scrub

No native drag helper exists for PanelComponent sliders — use the engine's SliderControl pattern: MousePanelEvent.LocalPosition over track width, with pointer-events routing.

building-ui · ✓ 26.07
Building an s&box HUD

One ScreenPanel host, static UIState for modals, self-closing panels, toast stack — BuildHash every flag the markup reads.

building-ui · ✓ 26.07
Character facing derived from velocity flips 180 degrees on every pendulum reversal

Deriving a visual's facing from horizontal velocity causes 180-degree snaps on any momentum reversal — lock facing to an attach-time azimuth for pendulums and oscillators.

tooling-environment · ✓ 26.07
Cloud assets fail silently under backend load after publish

Published game boots with error.vmdl placeholders; engine may rewrite prefab refs — no auto-retry; restart editor + republish.

publishing-shipping · ✓ 26.07
Collider choice that actually costs you

BoxCollider is cheap and follows WorldScale; Capsule/ModelCollider don't scale with WorldScale and ModelCollider is costly on clutter.

making-it-perform · ✓ 26.07
Cross-fade animations WITHOUT an AnimGraph

Set Sequence.Blending = true once — per-clip fade_in/fade_out times in the vmdl shape the blend; no AnimGraph required.

rigging-animation · ✓ 26.07
Decimating AI meshes without wrecking them

Census tris × instances first — silhouette fails before UVs; inject usemtl after scripted OBJ export.

getting-art-in · ✓ 26.07
Disabling per-instance shadows on ModelRenderer

ModelRenderer.CastShadows doesn't exist as a settable property — use renderer.SceneObject.Flags.CastShadows instead.

getting-art-in · ✓ 26.07
dotnet build verifies compile but NOT the whitelist

Headless dotnet build is green while the in-editor compiler emits SB1000 — Environment/IO/Process/reflection are banned in game code.

tooling-environment · ✓ 26.07
Double jump doesn't work with Jump() — set Velocity.z directly

Jump() helpers clamp against rising velocity, eating the second impulse. Set Velocity.z directly for a reliable double jump.

writing-gameplay · ✓ 26.07
Edit-mode Destroy() is deferred — scene queries return stale objects

GameObject.Destroy() in edit mode is deferred; a query fired right after returns the previous build's objects.

writing-gameplay · ✓ 26.07
Editing .razor safely (shell/emoji mojibake)

Razor HUD emoji and dashes die under Get-Content/Set-Content — edit with byte-safe UTF-8 APIs or a real editor.

tooling-environment · ✓ 26.07
Editor auto-exposure makes screenshot comparisons report false positives

Two screenshots of byte-identical geometry differ by tens of percent because editor auto-exposure adapts over wall-clock frames — settle the viewport and exposure-normalize before comparing.

writing-gameplay · ✓ 26.07
Editor play mode is hard-capped at 60 fps — cvars won't lift it

Editor-embedded play mode pins at exactly 60 fps regardless of cvars. The cap is the compositor's vsync on the editor window, not the engine frame sync.

making-it-perform · ✓ 26.07
Engine ships built-in McpTool source as readable C# — read it before writing your own

The engine ships its built-in [McpTool]s as full C# source, not compiled DLLs — check addons/tools/Code/Mcp/*.cs for canonical patterns before inventing your own.

tooling-environment · ✓ 26.07
Everything broke at once — check for a stale assembly first

Failed package compile leaves the editor running the last-good hotload — multi-symptom 'regressions' are often stale code.

tooling-environment · ✓ 26.07
FacingYawOffset swaps which local axis is the flip axis vs the cartwheel axis

A front-flip rotation uses _baseRot.Forward (not .Right) when FacingYawOffset is ±90° — the offset swaps which local axis is perpendicular to travel.

tooling-environment · ✓ 26.07
First successful Play: what to verify after the skeleton

Folders → sbproj → Assembly.cs → 4-object scene → green dotnet build → tagged logs on Play — then optional art tools.

getting-set-up · ✓ 26.07
Flex-grow track with a percentage-width child causes a layout feedback loop

A flex-grow slider track holding a normal-flow fill child sized by width:N% balloons wider as the value increases — take the fill out of flow with position:absolute.

building-ui · ✓ 26.07
Foot-sliding on locomotion — pace clips by their authored stride, not the controller's top speed

Foot-slide happens when PlaybackRate is tied to movement top speed instead of the clip's own authored stride distance.

rigging-animation · ✓ 26.07
Forge delivery fails but the preview GLB is still downloadable — recover it

Forge delivery job errors out but the build stage's previewGlbUrl stays downloadable — recover the GLB through Blender into your standard delivery shape instead of re-spending.

getting-art-in · ✓ 26.07
GameObject.Destroy keeps rendering in edit mode — deferred queue not processed between regenerations

A runtime-generated world root torn down with GameObject.Destroy() keeps rendering in edit mode because the deferred queue isn't flushed — use DestroyImmediate and sweep all matching roots.

writing-gameplay · ✓ 26.07
Getting set up: new project skeleton

.sbproj + Assets/Code/ProjectSettings/tools layout, 4-object scene + Bootstrap, dotnet build before anything else.

getting-set-up · ✓ 26.07
Greedy voxel mesher produces vertical stripes on cliff faces instead of horizontal strata

Per-cell dither or contour-wander in a greedy voxel mesher turns cliff skirts into vertical stripes — detect walls and key strata on raw height bands with dither neutralised.

writing-gameplay · ✓ 26.07
Ground snap pops on rolling slopes — rate-limit the downward snap

An idempotent ground-snap jitters on curved terrain because the slope curves away within each step — ease the downward snap at a bounded glue rate.

writing-gameplay · ✓ 26.07
Headless dotnet build misses Razor compile errors

dotnet build reports 0 errors on .razor files the in-editor compiler rejects — the headless build doesn't surface the Razor errors the live editor's Roslyn compiler flags.

tooling-environment · ✓ 26.07
Heavy work without frame hitches

GameTask.RunInThreadAsync for parse/math; main thread only for engine objects; Yield every N items for loading UI.

writing-gameplay · ✓ 26.07
High-key chalky sky is capped by two defaults — texture AND tonemapping must both change

A near-white chalky sky stays mid-grey or blue — fixing the sky texture alone isn't enough because the default tonemapping curve crushes highlights.

getting-art-in · ✓ 26.07
How we built a playable s&box game in a day with AI agents

Top model plans and reviews; cheaper agents execute on disjoint files; telemetry-driven feel tuning — whitelist and stale-assembly traps included.

ai-assisted-workflow · ✓ 26.07
Importing Kenney / CC0 kits into s&box

CC0 kits import like any OBJ+vmdl; city kits share colormap.png, nature kits need per-color vmats, and facing is a per-model yaw guess.

getting-art-in · ✓ 26.07
Input.config and AnalogMove for a new game

WASD as Forward/Backward/Left/Right feeds AnalogMove; new Input.config actions need an editor restart — dotnet build is not enough.

getting-set-up · ✓ 26.07
It worked in the editor but broke after publishing

Whitelist divergence, loose Resource Files, and silent cloud-asset failures after publish.

publishing-shipping · ✓ 26.07
Keep PackageReferences clean from day one

Standalone export hangs if PackageReferences still need sbox.game to resolve — don't accumulate cloud package deps casually.

getting-set-up · ✓ 26.07
Keep quaternion keys hemisphere-continuous

Converting euler poses per-key can land on q vs -q — the interpolation takes a violent 360-degree detour. Negate the quat if dot(prev, new) < 0.

rigging-animation · ✓ 26.07
Kinematic movement that doesn't get stuck

Always handle tr.StartedSolid — ignore that frame so an overlapped body can walk free; slide-trace the wish onto the hit plane.

writing-gameplay · ✓ 26.07
Loose resource files don't auto-publish

PNG/WAV/MP3/JSON must be listed in Project Settings → Resource Files without an assets/ prefix — #1 editor-vs-publish break.

publishing-shipping · ✓ 26.07
Minimal scene: Sun, Skybox, Camera, Bootstrap

Scene holds four GameObjects; Bootstrap OnStart builds the world in code — hotloads better, no scene/code drift.

getting-set-up · ✓ 26.07
ModelRenderer.Tint on flat-color vmats causes purple/black corruption

Per-instance Tint on a flat-color vmat (white PNG + g_vColorTint) rotates hue or crushes random instances to black — use scale/yaw jitter instead.

writing-gameplay · ✓ 26.07
My custom sound event won't play

Play full path WITH .sound or bare filename only — partial paths like impact/boing never resolve; compiled assets can still be invisible mid-session.

audio · ✓ 26.07
My interface scan returns nothing at runtime

OfType<IInteractable> on GetAllComponents<Component> returns nothing — enumerate concrete types and union them.

writing-gameplay · ✓ 26.07
My model has no collision even though it loads fine

RenderMeshFile alone compiles clean with zero physics — ModelCollider needs PhysicsMeshFile/PhysicsHullFile in the vmdl.

getting-art-in · ✓ 26.07
My model imported upside down / sideways / facing the wrong way

Blender +X becomes world −Y after OBJ import; yaw +90° faces +X — and Blender +Y rotation tips the +X edge down.

getting-art-in · ✓ 26.07
My s&box UI won't update / is frozen

BuildHash() is the only re-render trigger — hash everything the markup reads, including collection contents and flags.

building-ui · ✓ 26.07
My scaled-up tree's collider didn't scale

CapsuleCollider and ModelCollider ignore WorldScale; BoxCollider follows it — bake scale into import_scale instead.

getting-art-in · ✓ 26.07
New .razor.scss files are not applied until the editor restarts

A newly created .razor.scss file is not picked up by a running editor session — the panel component works but is unstyled until the next restart.

writing-gameplay · ✓ 26.07
No public per-action analog trigger axis — triggers are digital-only

GamepadCode-bound trigger actions are read as digital threshold presses only — there's no smooth 0..1 analog read per action. Use stick axes for continuous control.

writing-gameplay · ✓ 26.07
Noclip in a trace-based kinematic controller is a state, not a collider toggle

Disabling a collider does nothing for a hand-integrated kinematic controller — noclip must be a movement state that skips traces, gravity, and ground-snap entirely.

writing-gameplay · ✓ 26.07
Orient a flat decal box to the hit normal

Rotation.FromYaw alone leaves a decal flat on the floor — build a rotation that aligns the thin axis to the surface normal, then offset along it.

writing-gameplay · ✓ 26.07
Owner-simulated networking

[Sync] owner→proxies, IsProxy early-out; FromHost for shared truth — don't NetworkSpawn scene-wide singletons.

writing-gameplay · ✓ 26.07
PanelComponent uses OnTreeBuilt, not OnAfterTreeRender

OnAfterTreeRender(bool) is a Panel hook — on a PanelComponent it fails with CS0115; use parameterless OnTreeBuilt() or OnTreeFirstBuilt().

building-ui · ✓ 26.07
Per-cell white noise hash gives salt-and-pepper terrain instead of organic shade patches

A per-cell white-noise hash for terrain shade choice reads as a 50/50 checkerboard — use a smooth low-frequency noise field instead, confining the hash to threshold-edge dithering.

writing-gameplay · ✓ 26.07
Pick org and ident early for sbox.game

Ident is org.package — two lowercase segments; keep Org local until real; never put TODO placeholders in Org or the editor won't boot.

getting-set-up · ✓ 26.07
Ragdoll a scripted-rig NPC with pure engine physics

PhysicsShapeList + PhysicsJointList in the vmdl + ModelPhysics toggle — no collapse clips, no SetBoneTransform.

rigging-animation · ✓ 26.07
Retargeting free Mixamo mocap onto a custom rig

Transfer rest-delta rotations parent-relative (not world) — avoid the forward-hunch bug and never transform_apply scale on Mixamo armatures.

rigging-animation · ✓ 26.07
Rigging an AI-generated (rigless) character mesh

Bone-heat auto-weights fail on AI meshes — use scripted geodesic (along-surface) weights, then FBX + animated vmdl.

rigging-animation · ✓ 26.07
Rigidbody component API

Rigidbody API verified across multiple projects — Gravity, MassOverride, Velocity, ApplyForce, and the recipe for a dynamic pushable prop.

writing-gameplay · ✓ 26.07
Roboto Mono is the engine's monospace font

s&box ships Roboto Mono (all weights) — JetBrains Mono and Consolas only resolve on dev machines with those system fonts.

building-ui · ✓ 26.07
Rotation.FromYaw is counter-clockwise

Rotation.FromYaw(+angle) is a LEFT (CCW) turn — get the sign right or steering, AI, and autopilot spiral the wrong way.

writing-gameplay · ✓ 26.07
Runtime textures for UI panels must be assigned from C#

SCSS background-image only resolves asset paths — runtime Texture objects must be assigned via Panel.Style.BackgroundImage in OnTreeBuilt.

building-ui · ✓ 26.07
Runtime world-building helpers

FlatBox/Prop/Deco/Wire helpers plus Obstacle records as plain data beat physics queries for build validity.

writing-gameplay · ✓ 26.07
s&box component lifecycle in practice

OnAwake runs synchronously inside Components.Create — set singletons there; derive from [Property] in OnStart after spawn helpers assign.

writing-gameplay · ✓ 26.07
s&box project folder layout

Assets / Code / Editor / ProjectSettings / tools — the template every project follows.

getting-set-up · ✓ 26.07
s&box units are inches

1 m = 39.37 engine units — design in SI, convert once at the engine boundary, and audit every consumer.

getting-art-in · ✓ 26.07
s&box won't load my OBJ/GLB

Scenes never load raw OBJ/GLB — always wrap with a .vmdl and remap materials under both bare and .vmat names.

getting-art-in · ✓ 26.07
Save/load without drift

DTOs + one spawn path + deterministic static world — guard restored defaults; keep enums append-only.

writing-gameplay · ✓ 26.07
Scene.GetAllComponents skips disabled components

A component with Enabled = false is invisible to GetAllComponents — search returns null even though the component exists.

writing-gameplay · ✓ 26.07
Sound.Play() is fully static — no component wiring needed

Sound playback is a static call, not a component. Use Sound.Play() for 2D and Sound.Play(pos) for 3D, and handle missing events gracefully.

audio · ✓ 26.07
Stalled Steam update half-deletes the s&box install

If sbox-launcher.exe stays open during a Steam update, files vanish mid-install — validate via steam://validate/590830.

tooling-environment · ✓ 26.07
Standalone Steam export

Preview as of 2026-07: Valve approval + Facepunch license; full .NET, lose platform services; clean PackageReferences or startup hangs.

publishing-shipping · ✓ 26.07
TextEntry is the house control, not HTML input

Use TextEntry with onsubmit and OnTextEdited — standard Blazor input bindings compile but are not how the engine UI works.

building-ui · ✓ 26.07
TextEntry.OnTextEdited needs an explicit-type block lambda

An untyped or expression-bodied lambda on TextEntry.OnTextEdited fails with CS8917 or CS0029 — use an explicit param type plus a block body.

writing-gameplay · ✓ 26.07
The bone-name `.` → `_` compiler trap

Model compiler rewrites upper_arm.L → upper_arm_L; physics KV3 that still says .L makes limb bodies unknown while the torso works.

rigging-animation · ✓ 26.07
The FBX export recipe that actually works

Default −Z/Y axes, bake_space_transform, no leaf bones, X/Z bone axes, mesh FBX + per-clip armature FBX; scale via ScaleAndMirror 0.3937.

rigging-animation · ✓ 26.07
The Razor @namespace trap

Razor classes get a RootNamespace/folder-derived namespace — declare @namespace and global using or C# can't find your panels.

building-ui · ✓ 26.07
The singleton pattern that removes reference-wiring

static Instance set in OnAwake, cleared in OnDestroy — everything reads Foo.Instance with null-guards, no inspector wiring.

writing-gameplay · ✓ 26.07
There's no Looping field on SoundEvent

SoundEvent has no Looping property — loop via compiled vsnd import options, or re-trigger from code when SoundHandle finishes.

audio · ✓ 26.07
Title / Ident / StartupScene fields that bite new projects

StartupScene is what Play loads; Org must be a valid lowercase ident — placeholders break editor bootstrap, not just publishing.

getting-set-up · ✓ 26.07
Too many font-size declarations corrupt UI text rendering

Many selectors declaring font-size in one SCSS file can make text render as solid filled rectangles — carry hierarchy via font-weight/color instead.

building-ui · ✓ 26.07
Trace-based kinematic controllers don't fire triggers

A hand-integrated trace mover has no collider component — ITriggerListener and OnTriggerEnter never fire. Use distance-polling instead.

writing-gameplay · ✓ 26.07
Understanding the Play Fund

No paid storefront — revenue is clamped player-hours from a daily pool; retention is the monetization feature.

publishing-shipping · ✓ 26.07
Unknown shader field? Check the engine's own templates before grepping projects

Shader field support is unknown and no .shader source exists — check the install's templates/ folder for authoritative syntax instead of grepping sibling projects.

getting-art-in · ✓ 26.07
Using AI-generated 3D models in a real s&box game

AI mesh generators (Tripo, Meshy, Rodin) deliver textured OBJ+vmdl — but modeldoc32 headers, ~1m normalize, corrupt textures, bare texture paths, and missing colliders will ERROR the asset until patched.

getting-art-in · ✓ 26.07
Vector3.Right is (0, -1, 0) — not +X

Source engine convention: Forward = +X, Left = +Y, Right = -Y. Using Vector3.Right for '+X' silently slides geometry the wrong way.

getting-art-in · ✓ 26.07
What hotload does (and doesn't) for a new project

C# hotloads on alt-tab in ms; scene changes and new Input.config actions need Play/editor restart; failed compile keeps the last-good assembly.

getting-set-up · ✓ 26.07
Whitespace next to a Razor tag or expression boundary collapses to nothing

Literal spaces adjacent to a tag or @-expression boundary vanish in Razor markup — use a single interpolated string or CSS margin instead.

writing-gameplay · ✓ 26.07
Why SetBoneTransform / SetIk silently do nothing

SetIk is AnimGraph-gated; SetBoneTransform is unsound on clip-keyed bones — use proxy props, whole-visual motion, or commit to AnimGraph.

rigging-animation · ✓ 26.07
Windows/PowerShell traps that corrupt s&box source

Get-Content/Set-Content re-encodes BOM-less UTF-8 as ANSI; CRLF files break \n-only search-replace — use byte-safe APIs.

tooling-environment · ✓ 26.07
Wiring Sandbox.Services

Stats.Increment/SetValue, Leaderboards.GetFromStat, Achievements.Unlock — cheap platform polish; total achievement score capped at 1000.

publishing-shipping · ✓ 26.07