tag

#silent-failure

75 items (75 fixes)

fixes
26.07.22
"[Sync] component created after NetworkSpawn silently never replicates"

A component with [Sync] fields added in OnStart (after NetworkSpawn) never replicates: each peer creates its own local instance and the sync pair silently never matches. The law covers engine components too: a Rigidbody built post-spawn is exactly this bug (Velocity is [Sync]-backed).

26.07.08e
"@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.

26.08.05
"A component added at runtime updates after every authored one"

Update order is a property of the authored scene. A component added at runtime with Components.GetOrCreate goes on the end of the update list, no matter which GameObject it sits on. Per-frame input written from it lands too late for movement code that reads it the same frame. Drive the runtime component from an authored component's tick.

26.07.22
"A give-up timer gated on a control signal never fires when the control pulses through its reset value"

A timeout accumulator gated on a control-signal sample (throttle > threshold) resets to zero on frames where the signal legitimately reads zero, so it never fills. A gear change drives the throttle magnitude through zero on a fixed cadence, and an unstick routine that alternates gears makes that happen forever, so a stuck vehicle is never declared wrecked. Drive give-up timers from ground-truth state, such as position progress since the last known-good, never from a control signal that pulses through the reset value by design.

26.07.22
"A panel's width and height are the outer size (border-box by default)"

In s&box razor UI the declared width/height of a panel is the OUTER number: padding and borders sit inside it, not added on top. The default already behaves like box-sizing: border-box, with no such declaration anywhere. Author every width/height as the outer number the mockup shows; adding padding/border by hand under-sizes every box by exactly its own padding.

26.07.22
"A public Reset() on a Component silently shadows the engine's Component.Reset()"

Naming a Component method `public void Reset()` compiles clean and silently hides the engine's own `Component.Reset()`. The only signal is a CS0114 warning, which `dotnet build -v q` never prints. Green is not the same as warning-free: pick a different name (ResetState, Clear) unless you deliberately mean to hook the lifecycle method.

26.07.15a
"A runtime-written Data-filesystem image needs a code Texture, not a CSS background-image URL"

An image you write to FileSystem.Data at runtime (a per-save thumbnail, a screenshot) is not addressable from a CSS background-image URL -- those resolve against mounted content, not the user Data FS. Decode it into a Texture in code and assign Style.BackgroundImage instead.

26.08.05
"A Scene.Trace only reports a model hitbox when it opts in with UseHitboxes(true)"

Scene.Trace leaves SceneTraceResult.Hitbox null unless the trace calls .UseHitboxes(true). A target that carries model hitboxes but no body collider is invisible to a plain trace: the ray reports no hit at all. Mixing a coarse collider with hitboxes lets the collider shadow them, so a head shot resolves as a body hit.

26.07.08e
"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.

26.08.05
"An automated input harness reads zero movement unless it runs first and injects on both steps"

A component that injects movement input for automated testing has to sit first in the scene hierarchy and write on both OnUpdate and OnFixedUpdate, or every movement phase reads zero while looking still works. Input.AnalogMove is computed once per frame from the movement actions before components run, so setting the Forward/Back/Left/Right actions afterward moves nothing that frame. Write Input.AnalogMove directly for held movement instead. Components run in scene order, so a harness under the controlled character runs after the stock mover and its writes land one frame late, then get wiped. Movement is consumed on the fixed step while looking is consumed on the per-frame update, so a harness that injects only from OnUpdate passes every look phase and reads exactly zero on every movement phase.

26.08.05
"An ICameraModifier writes to every camera that draws, including the editor viewport"

An ICameraModifier runs against every camera that draws, including the editor viewport camera during play-in-editor, not just the camera its component belongs to. A modifier that writes only some view fields makes the viewport obey some instructions and ignore others. A first-person modifier that set view.Rotation but not view.Position froze the editor viewport at the player aim, so a camera tool had its position honoured and its rotation discarded. A transform readback cannot see this, because the override happens later during view composition. Filter every modifier callback to the game view with a check on IsMainCamera.

26.07.22
"An unbaked sound-mixer slot resolves to null and plays nothing, silently"

A custom sound-mixer slot with no baked pick and no fallback event resolves to null and plays nothing, with zero log lines anywhere. A fully wired audio call stack can be completely mute behind a clean console. When sound is missing and the console is silent, check whether the mix was actually baked for that slot before blaming the caller.

26.07.15a
"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.

26.07.22
"Attachments and bones read wrong on the spawn frame"

A SkinnedModelRenderer created this frame has no attachment objects yet, and reading a bone before the first pose evaluates returns the bind pose. Resolving a mount in OnStart silently gets nulls or T-pose transforms, no exception either way. Defer and retry.

26.07.08e
"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.

26.08.05
"Bind lazily to a component created in OnStart, not from your own OnStart"

A scene-authored component cannot resolve, inside its own OnStart, a component that another component creates inside that other component's OnStart. Authored beside is not authored before, so the binder looks up the target before it exists, gets null, and holds that null for the whole session behind one warning line. The whole feature does nothing while every part it depends on works. Bind lazily instead: retry the lookup on a short interval until the target resolves, and warn once if it never does.

26.07.15a
"border-style: solid is a parse error that kills the whole stylesheet"

border-style: solid is a parse error in s&box scss. The invalid property aborts the whole stylesheet, collapsing the panel to zero size -- invisible, not just unbordered.

26.07.22
"box-shadow: inset paints outside the element in Razor panels"

The inset keyword on box-shadow is effectively ignored in s&box Razor panels: an inner vignette renders as an outer halo, and a full-screen inset vignette renders nothing at all. Build inner glows and vignettes from linear-gradient bands instead.

26.07.22
"Citizen animgraph combat params are unwrapped and unnetworked"

The stock citizen animgraph ships combat params that CitizenAnimationHelper does NOT wrap -- drive them with renderer.Set() directly, and replicate them yourself because the engine only networks locomotion.

26.07.15a
"Components.Get misses a SkinnedModelRenderer on a child object"

Components.Get<SkinnedModelRenderer>() only searches the same GameObject: a renderer on a child returns null, silently no-oping every Set() call.

26.07.08e
"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.

26.07.22
"DirectionalLight.LightColor is a hue control, not a brightness dial"

Scaling DirectionalLight.LightColor does not dim the sun: from 0.001 to 5.0 it renders identically; only Color.Black turns it off. LightColor sets hue, not brightness. A day/night brightness ramp built on it is a silent no-op.

26.07.08e
"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.

26.07.08e
"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.

26.07.08e
"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.

26.07.08e
"Editor stuck running stale assembly with green compile: only a restart clears it"

compile_status is fully green and the editor accepts edits, but Play executes the OLD code: touch, syntax-error cycling, and play restart all fail. Only a full editor process restart clears it.

26.07.08e
"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.

26.07.08e
"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.

26.07.22
"FirstOrDefault() on SkinnedModelRenderer can grab clothing, not the body"

On a dressed citizen, GetAllComponents<SkinnedModelRenderer>().FirstOrDefault() can return a bone-merged clothing renderer (a hat) instead of the body, silently, with no null. A sequence probe then reports every clip absent. Select the body renderer explicitly.

26.07.15a
"FP cosmetics need a parallel viewmodel copy, not a re-tagged world child"

When a world model is FP-hidden and replaced by a camera-attached viewmodel, cosmetics that must remain visible in FP need a separate copy parented into the viewmodel. Never re-tag the world copy visible.

26.07.22
"Freeze a physics actor by going kinematic, not by destroying its Rigidbody"

Turning a composite physics actor into static scenery by destroying its Rigidbody silently kills every child system that keyed its own liveness off that body. Set MotionEnabled = false instead: the body stays alive, dependents keep ticking, and a kinematic body reads zero delta-v for free.

26.07.08e
"Getting set up: new project skeleton"

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

26.07.15a
"Grounded wish-speed servo silently destroys applied velocity"

A grounded wish-speed servo (MoveTowards) silently clamps any externally applied velocity (mantle carry, knockback, launch) to the wish target within a few ticks of ground contact -- boundary measurements read green while the effect is imperceptible.

26.07.08e
"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.

26.07.08e
"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.

26.07.08e
"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.

26.07.08e
"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.

26.07.18
"Library extraction seam must cover every side effect"

A library extraction seam covers only the headline behavior: every other side effect of the replaced code path silently disappears unless explicitly reproduced on the consumer side.

26.07.08e
"Minimal scene: Sun, Skybox, Camera, Bootstrap"

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

26.07.22
"Model.Load of a missing vmdl returns the error model, not null"

Model.Load of a missing vmdl can return the orange ERROR mesh with the requested path as its Name: check IsError, not just null. And a failed load is cached for the life of the editor PROCESS: play_stop/play_start won't clear it, only a fresh editor will.

26.07.22
"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.

26.07.22
"My interface scan returns nothing at runtime"

OfType<IInteractable> on GetAllComponents<Component> returns nothing: GetAllComponents answers off a concrete-type index, so enumerate concrete types (or a shared abstract base) and union them.

26.07.08e
"Naming a property 'Active' shadows Component.Active"

Component.Active is a real inherited member: naming your own bool Active silently shadows the engine's enabled flag. It is a CS0108 warning, not an error, so it ships easily; treat CS0108 as an error in code review.

26.07.08e
"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.

26.07.08e
"Owner-simulated networking"

[Sync] owner→proxies, IsProxy early-out; FromHost for shared truth. Every object carrying a [Sync] field has to be NetworkSpawned, singletons included.

26.07.08e
"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.

26.07.22
"Prune a waypoint graph by connected component, not by isolated nodes"

A waypoint-graph builder that prunes only isolated nodes still ships fully-connected but walled-off pockets, because graph kept is not graph reachable. In one build, sealed arena corners stranded 27 of 524 nodes as three internal pockets, and about 5% of a max crowd spawned where it could never leave. Filter destination and spawn candidates by connected component, using a flood fill from a known-good root, not by per-node validity checks.

26.07.15a
"radial-gradient with a CSS shape keyword errors as a color and drops the rule"

s&box's radial-gradient parser accepts a color-stop list only. A standard CSS shape/size/position prelude (circle, ellipse, at 50% 50%) is read as the first color stop and aborts with a red 'Cannot read a color from ...' Code Error, silently dropping the rule. Write color stops only.

26.08.05
"Ragdoll a scripted-rig NPC with pure engine physics"

PhysicsShapeList + PhysicsJointList in the vmdl + ModelPhysics toggle. No collapse clips, no SetBoneTransform. On current builds ModelPhysics.PhysicsGroup reads NULL: enumerate ModelPhysics.Bodies directly and resolve bones by name→index.

26.07.18
"Razor tag resolution ignores global usings"

Razor component tag resolution does not consult global using directives: a library component renders as an inert HTML element while its class resolves fine in code-behind.

26.07.15a
"RenderExcludeTags on a tagged parent culls all child renderers too"

GameObject.Tags inherit to all descendants, so a CameraComponent.RenderExcludeTags exclusion on a tagged object culls every child renderer too: cosmetics attached as children silently vanish.

26.07.22
"Resolve identity by registry, not by walking the tag chain"

A 'walk up the parent chain to the first ancestor tagged X' resolver silently breaks the moment any later pass tags a descendant with the same tag: the walk stops on the nearest match, not the intended root. Resolve identity against an authoritative roster instead, especially when the tag is also used for physics filtering.

26.07.08e
"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.

26.07.08e
"Rpc.Broadcast on a non-networked GameObject runs locally only -- no warning"

An [Rpc.Broadcast] called on a component whose GameObject is not networked executes locally and silently never crosses the wire -- no warning at any log level.

26.07.08e
"s&box component lifecycle in practice"

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

26.07.08e
"s&box project folder layout"

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

26.07.08e
"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.

26.07.08e
"Save/load without drift"

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

26.07.08e
"Scene.GetAllComponents skips disabled components"

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

26.07.08e
"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.

26.07.08e
"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.

26.07.08e
"Static registry populated by a static constructor doesn't pick up new entries on hotload"

s&box carries old static state forward on hotload and never re-runs static constructors: a registry entry added in source is absent at runtime despite green compile.

26.07.08e
"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.

26.07.08e
"The Razor @namespace trap"

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

26.07.08e
"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.

26.07.08e
"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.

26.07.08e
"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.

26.07.08e
"Too many font-size declarations (or too much text) corrupt UI glyph rendering"

SUPERSEDED: the font-size-declaration-count theory below was owner-settled (26.07.22) to be a CAPTURE-PATH artifact, not a real render bug. Panels with these exact font-size declarations render pin-sharp on the physical screen. Never strip font-size from a shipping stylesheet to 'fix' captures. See camera-screenshot-cannot-verify-fonts.

26.07.08e
"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.

26.07.22
"Undefined SCSS variable silently kills panels at runtime"

An undefined SCSS variable in a .razor.scss fails at runtime with only a console warning (no compile error, no toast) and the affected panels can render fully invisible. A trailing // comment on a value line fails the same way.

26.07.08e
"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.

26.07.22
"Visible cursor blocks game mouse input: no raw bypass exists"

With a visible cursor (MouseVisibility.Visible), mouse buttons that land on a pointer-events panel never reach Input.Down/Pressed, and Input.Keyboard.Down("mouse2") is not a bypass. Raw Mouse.Delta stays live, though, creating a separate trap.

26.07.08e
"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.

26.08.05
"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.

26.07.08e
"Wiring Sandbox.Services"

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

Want to know when new guides or fixes drop? Join the community to help build this out. Report gotchas, flag outdated fixes, or just lurk.

Join the Discord