groupsCommunity
Common s&box component gotchas — physics, networking, scene, and rendering pitfalls
Common s&box Component Gotchas
Practical pitfalls that catch most new s&box developers.
Physics
Rigidbody + CharacterController on the same GO — don't do it. They fight each other. Use one or the other. Collider with no Rigidbody — the collider is static (immovable). That's fine for world geometry. Add a Rigidbody only if you want it to move. IsTrigger = true but no ITriggerListener — the trigger fires but nothing responds. Make sure a component on the same GO implements ITriggerListener.Networking
[Sync] property not updating on clients — the property must be on a component that is on a networked GameObject (one with NetworkMode != None). Check IsNetworkRoot on the parent. Calling an [Authority] method from a client — this silently does nothing. Use [Broadcast] for client→server→all, or [Rpc.Host] for client→server only.Components
Components.Get<T>() returns null — use Components.TryGet<T>( out var c ) to avoid null refs, or Components.GetOrCreate<T>() if you always want one. [RequireComponent] doesn't auto-add in code — it only auto-adds in the editor inspector. In code, create the required component manually before accessing it.Scene
Scene.CreateObject() during OnStart — safe. During OnAwake — can cause ordering issues. Prefer OnStart for spawning child objects. GameObject.Destroy() is deferred — the GO isn't removed until end of frame. Use IsValid() checks rather than null checks after calling Destroy().Rendering
SkinnedModelRenderer with UseAnimGraph = false — animation parameters set via renderer.Set(...) are ignored. Enable UseAnimGraph or use renderer.SetAnimParameter(...) directly. SkyBox2D with SkyIndirectLighting = false — outdoor scenes look flat. Always enable it unless you're using a custom GI setup.
Was this helpful?