tag

#gameplay

21 items (2 guides · 19 fixes)

guides
fixes
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.15a
"Dev-host streaming skips loose data files, breaking deterministic sync"

Dev-host streaming sends assemblies and compiled assets but NOT loose data files read via FileSystem.Mounted: a joining client that loads a raw JSON manifest builds differently, silently.

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

26.07.08e
"Heavy work without frame hitches"

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

26.07.15a
"Joining client's singleton claim grabs the host's character"

A static Instance claimed behind if (!IsProxy) in OnStart grabs the host's character on a joining client: the client camera follows the wrong player forever.

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.22
"Local two-peer multiplayer testing with -joinlocal"

sbox.exe -joinlocal +instanceid 1 gives you a real second peer against an editor host with no publish, no second Steam account, and no lobby discovery. It has no host selector: it joins whichever local editor is in PLAY MODE, so no other editor on the machine may be playing.

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.15a
"OnDisabled nulls a singleton, blocking re-adoption forever"

A singleton claimed in OnEnabled and nulled in OnDisabled traps any re-adopt poll that gates on Instance.IsValid(): the entity is never re-driven after a disable.

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
"Runtime world-building helpers"

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

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
"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
"Single-tick ground-check flicker machine-guns the landing squash"

A trace-based ground controller flickers Ground/Air on seams, re-firing landing VFX mid-run. Require minimum air time before a JustLanded counts.

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
"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.08e
"Trajectory preview dots bunch at the apex: sample by arc length, not time"

Even-time samples of a ballistic arc cluster at the slow apex and spread at the fast ends: sample by arc length for evenly spaced preview dots.

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