diff --git a/unity/Runtime/Components/MjComponent.cs b/unity/Runtime/Components/MjComponent.cs index 1371c001..3b69668f 100644 --- a/unity/Runtime/Components/MjComponent.cs +++ b/unity/Runtime/Components/MjComponent.cs @@ -99,7 +99,7 @@ public abstract class MjComponent : MonoBehaviour { } public void OnDisable() { - if (!_exiting) { + if (!_exiting && MjScene.InstanceExists) { MjScene.Instance.SceneRecreationAtLateUpdateRequested = true; } }