NetCode + DOTS Editor exceptions

I am getting a ton of exceptions in my console, just as if one of the default systems was not initialized:

A couple of these, saying there’s something wrong with ClientPresentationSystemGroup:

InvalidOperationException: object is not initialized or has already been destroyed
Unity.Entities.ComponentSystemBase.CheckedState () (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/ComponentSystemBase.cs:333)
Unity.Entities.JobComponentSystem.Update () (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/JobComponentSystem.cs:109)
Unity.Entities.ComponentSystemGroup.UpdateAllSystems () (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/ComponentSystemGroup.cs:445)
UnityEngine.Debug:LogException(Exception)
Unity.Debug:LogException(Exception) (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/Stubs/Unity/Debug.cs:19)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/ComponentSystemGroup.cs:450)
Unity.Entities.ComponentSystemGroup:OnUpdate() (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/ComponentSystemGroup.cs:398)
Unity.NetCode.ClientPresentationSystemGroup:OnUpdate() (at Library/PackageCache/com.unity.netcode@0.2.0-preview.5/Runtime/ClientServerWorld/ClientPresentationSystemGroup.cs:22)
Unity.Entities.ComponentSystem:Update() (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/ComponentSystem.cs:109)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/ComponentSystemGroup.cs:445)
Unity.Entities.ComponentSystemGroup:OnUpdate() (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/ComponentSystemGroup.cs:398)
Unity.Entities.ComponentSystem:Update() (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/ComponentSystem.cs:109)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/ComponentSystemGroup.cs:445)
Unity.Entities.ComponentSystemGroup:OnUpdate() (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/ComponentSystemGroup.cs:398)
Unity.Entities.ComponentSystem:Update() (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/ComponentSystem.cs:109)
Unity.Entities.DummyDelegateWrapper:TriggerUpdate() (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/ScriptBehaviourUpdateOrder.cs:192)

This one:

InvalidOperationException: object is not initialized or has already been destroyed
Unity.Entities.ComponentSystemBase.CheckedState () (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/ComponentSystemBase.cs:333)
Unity.Entities.ComponentSystemBase.get_EntityQueries () (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/ComponentSystemBase.cs:353)
Unity.Entities.Editor.EntityQueryListView.get_NeedsReload () (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities.Editor/EntityDebugger/EntityQueryListView.cs:281)
Unity.Entities.Editor.EntityQueryListView.ReloadIfNecessary () (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities.Editor/EntityDebugger/EntityQueryListView.cs:288)
Unity.Entities.Editor.EntityDebugger.OnGUI () (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities.Editor/EntityDebugger/EntityDebugger.cs:533)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <d302ee0b7fcd4d8184c0fe84f62c3cc1>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <d302ee0b7fcd4d8184c0fe84f62c3cc1>:0)
UnityEditor.DockArea.OldOnGUI () (at <d302ee0b7fcd4d8184c0fe84f62c3cc1>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <e1c6d781608a4604a07d126a96d78d19>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

21 of these, still related to ClientPresentationSystemGroup:

InvalidOperationException: object is not initialized or has already been destroyed
Unity.Entities.ComponentSystemBase.CheckedState () (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/ComponentSystemBase.cs:333)
Unity.Entities.JobComponentSystem.Update () (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/JobComponentSystem.cs:109)
Unity.Entities.ComponentSystemGroup.UpdateAllSystems () (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/ComponentSystemGroup.cs:445)
UnityEngine.Debug:LogException(Exception)
Unity.Debug:LogException(Exception) (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/Stubs/Unity/Debug.cs:19)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/ComponentSystemGroup.cs:450)
Unity.Entities.ComponentSystemGroup:OnUpdate() (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/ComponentSystemGroup.cs:398)
Unity.NetCode.ClientPresentationSystemGroup:OnUpdate() (at Library/PackageCache/com.unity.netcode@0.2.0-preview.5/Runtime/ClientServerWorld/ClientPresentationSystemGroup.cs:22)
Unity.Entities.ComponentSystem:Update() (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/ComponentSystem.cs:109)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/ComponentSystemGroup.cs:445)
Unity.Entities.ComponentSystemGroup:OnUpdate() (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/ComponentSystemGroup.cs:398)
Unity.Entities.ComponentSystem:Update() (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/ComponentSystem.cs:109)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/ComponentSystemGroup.cs:445)
Unity.Entities.ComponentSystemGroup:OnUpdate() (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/ComponentSystemGroup.cs:398)
Unity.Entities.ComponentSystem:Update() (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/ComponentSystem.cs:109)
Unity.Entities.DummyDelegateWrapper:TriggerUpdate() (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities/ScriptBehaviourUpdateOrder.cs:192)

69 of these, I guess, related to the ClientPresentationSystemGroup not being initialized with a reference to world:

NullReferenceException: Object reference not set to an instance of an object
Unity.Entities.Editor.SystemListView.get_NeedsReload () (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities.Editor/EntityDebugger/SystemListView.cs:507)
Unity.Entities.Editor.SystemListView.ReloadIfNecessary () (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities.Editor/EntityDebugger/SystemListView.cs:528)
Unity.Entities.Editor.EntityDebugger.OnGUI () (at Library/PackageCache/com.unity.entities@0.11.0-preview.7/Unity.Entities.Editor/EntityDebugger/EntityDebugger.cs:531)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <d302ee0b7fcd4d8184c0fe84f62c3cc1>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <d302ee0b7fcd4d8184c0fe84f62c3cc1>:0)
UnityEditor.DockArea.OldOnGUI () (at <d302ee0b7fcd4d8184c0fe84f62c3cc1>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <e1c6d781608a4604a07d126a96d78d19>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

And 1k+ of these with the same thing:

NullReferenceException: Object reference not set to an instance of an object
Unity.Entities.Editor.ComponentSystemBaseNode`2[TSystem,TNode].get_WorldName () (at Library/PackageCache/com.unity.dots.editor@0.7.0-preview.1/Editor/SystemSchedule/PlayerLoop/ComponentSystemNodes.cs:15)
Unity.Entities.Editor.ComponentSystemBaseNode`2[TSystem,TNode].get_Hash () (at Library/PackageCache/com.unity.dots.editor@0.7.0-preview.1/Editor/SystemSchedule/PlayerLoop/ComponentSystemNodes.cs:24)
Unity.Entities.Editor.PlayerLoopSystemGraph.DidChange (Unity.Entities.Editor.IPlayerLoopNode lhs, Unity.Entities.Editor.IPlayerLoopNode rhs) (at Library/PackageCache/com.unity.dots.editor@0.7.0-preview.1/Editor/SystemSchedule/PlayerLoop/PlayerLoopSystemGraph.cs:70)
Unity.Entities.Editor.PlayerLoopSystemGraph.DidChange (Unity.Entities.Editor.IPlayerLoopNode lhs, Unity.Entities.Editor.IPlayerLoopNode rhs) (at Library/PackageCache/com.unity.dots.editor@0.7.0-preview.1/Editor/SystemSchedule/PlayerLoop/PlayerLoopSystemGraph.cs:75)
Unity.Entities.Editor.PlayerLoopSystemGraph.DidChange (Unity.Entities.Editor.IPlayerLoopNode lhs, Unity.Entities.Editor.IPlayerLoopNode rhs) (at Library/PackageCache/com.unity.dots.editor@0.7.0-preview.1/Editor/SystemSchedule/PlayerLoop/PlayerLoopSystemGraph.cs:75)
Unity.Entities.Editor.PlayerLoopSystemGraph.DidChange (Unity.Entities.Editor.IPlayerLoopNode lhs, Unity.Entities.Editor.IPlayerLoopNode rhs) (at Library/PackageCache/com.unity.dots.editor@0.7.0-preview.1/Editor/SystemSchedule/PlayerLoop/PlayerLoopSystemGraph.cs:75)
Unity.Entities.Editor.PlayerLoopSystemGraph.DidChange (Unity.Entities.Editor.IPlayerLoopNode lhs, Unity.Entities.Editor.IPlayerLoopNode rhs) (at Library/PackageCache/com.unity.dots.editor@0.7.0-preview.1/Editor/SystemSchedule/PlayerLoop/PlayerLoopSystemGraph.cs:75)
Unity.Entities.Editor.PlayerLoopSystemGraph.DidChange (Unity.Entities.Editor.PlayerLoopSystemGraph lhs, Unity.Entities.Editor.PlayerLoopSystemGraph rhs) (at Library/PackageCache/com.unity.dots.editor@0.7.0-preview.1/Editor/SystemSchedule/PlayerLoop/PlayerLoopSystemGraph.cs:55)
Unity.Entities.Editor.PlayerLoopSystemGraph.ValidateCurrentGraph () (at Library/PackageCache/com.unity.dots.editor@0.7.0-preview.1/Editor/SystemSchedule/PlayerLoop/PlayerLoopSystemGraph.cs:37)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <d302ee0b7fcd4d8184c0fe84f62c3cc1>:0)

I would really appreciate it if someone helped to fix this anyhow. All the errors seem to be internal to the Unity packages. Thank you!

I have found the issue within the following block. Still not sure how this system is related to all of this. As soon as I commented the line, it started working with no issue:

            var sCopySkinnedEntityDataToRenderEntity = World.GetExistingSystem<CopySkinnedEntityDataToRenderEntity>();
            if (sCopySkinnedEntityDataToRenderEntity != null)
            {
                sCopySkinnedEntityDataToRenderEntity.Enabled = false;
                //World.DestroySystem(sCopySkinnedEntityDataToRenderEntity);
            }

This block was added to fix another bug, caused by not using animation package, I guess

1 Like

I do not have this issue despite not using the animation package but in any case, thanks for early figuring out problems with the new NetCode version!