"Scene.GetAllComponents skips disabled components"
You pre-create a component with Enabled = false (intending to enable it later), then search for it with Scene.GetAllComponents<T>().FirstOrDefault() — the search returns null. A camera swap, possession handoff, or any logic that finds-then-enables silently no-ops, and the system stays stuck in its initial state.
Scene.GetAllComponents<T>() only returns enabled components. A disabled component is invisible to the type-search API entirely. This is by design — the scene query reflects what's currently active, not everything that exists.
Option A — search via the GameObject (when you know where it lives):
// Find an enabled sibling on the same GameObject, then access the disabled one directly
var orbit = Scene.GetAllComponents<OrbitCamera>().FirstOrDefault();
if ( orbit is not null )
{
var chase = orbit.GameObject.Components.Get<ChaseCamera>( includeDisabled: true );
chase.Enabled = true;
orbit.Enabled = false;
}Option B — create on demand (cleaner for transient components):
// Instead of pre-creating disabled, create when needed and destroy when done
void OnPossess( GameObject target )
{
var cam = target.Components.Create<ChaseCamera>();
cam.FollowTarget = target;
}
void OnRelease( GameObject target )
{
target.Components.Get<ChaseCamera>()?.Destroy();
}Option B avoids the disabled-invisible problem entirely — if a component only exists while active, it's always findable.
This is a silent failure — no error, no warning, just a null return where you expected a component. The pre-create-disabled pattern is natural (set up everything at init, toggle later), but it's incompatible with scene-wide type searches. Choose between direct GameObject access or create-on-demand to stay visible to the query API.