Pretty much when I hit play Cinemachine completely bugs out but only the free-look camera is affected. After exiting play mode and selecting the camera the inspector doesn’t get drawn and I am prompted with 2 errors. This continues until I reimport Cinemachine then it goes back to “normal” until I hit play again. The camera still works when I hit play, the UI is just bugged and my post-processing doesn’t work on the camera either.
The errors:
" NullReferenceException: Object reference not set to an instance of an object
Unity.Scenes.Editor.ConversionWarningsGui.GetWarnings (UnityEngine.GameObject gameobject) (at Library/PackageCache/com.unity.entities@0.0.12-preview.29/Unity.Scenes.Editor/ConversionWarningsEditor.cs:52)"
and
“ArgumentException: Getting control 0’s position in a group with only 0 controls when doing repaint
Aborting
UnityEngine.GUILayoutGroup.GetNext () (at C:/buildslave/unity/build/Modules/IMGUI/LayoutGroup.cs:122)”
Everything has worked fine for months before today but now it just doesn’t seem to want to work anymore. I even tried reimporting and reinstalling Cinemachine. Does anyone know whats going on?
What versions of Unity and Cinemachine?
“com.unity.entities@0.0.12-preview.29” makes me nervous. What have you got in there?
Unity: 2019.1.7f1
Cinemachine: 2.3.4 (supposedly the latest version)
I was initially using 2019.1.4 and tried going up a version to see if that would fix it. That was, in fact, was not the solution unless 2019.1.10 has some magical bug fix for this.
Here are the full error codes:
“NullReferenceException: Object reference not set to an instance of an object
Unity.Scenes.Editor.ConversionWarningsGui.GetWarnings (UnityEngine.GameObject gameobject) (at Library/PackageCache/com.unity.entities@0.0.12-preview.29/Unity.Scenes.Editor/ConversionWarningsEditor.cs:52)
Unity.Scenes.Editor.ConversionWarningsGui.GetWarning (UnityEditor.Editor editor) (at Library/PackageCache/com.unity.entities@0.0.12-preview.29/Unity.Scenes.Editor/ConversionWarningsEditor.cs:37)
Unity.Scenes.Editor.ConversionWarningsGui.Callback (UnityEditor.Editor editor) (at Library/PackageCache/com.unity.entities@0.0.12-preview.29/Unity.Scenes.Editor/ConversionWarningsEditor.cs:24)
UnityEditor.Editor.DrawHeader () (at C:/buildslave/unity/build/Editor/Mono/Inspector/Editor.cs:730)
UnityEditor.UIElements.EditorElement.DrawEditorLargeHeader (System.Boolean& wasVisible) (at C:/buildslave/unity/build/Editor/Mono/Inspector/EditorElement.cs:284)
UnityEditor.UIElements.EditorElement.DrawEditorHeader (UnityEngine.Object target, System.Boolean& wasVisible) (at C:/buildslave/unity/build/Editor/Mono/Inspector/EditorElement.cs:245)
UnityEditor.UIElements.EditorElement.HeaderOnGUI () (at C:/buildslave/unity/build/Editor/Mono/Inspector/EditorElement.cs:193)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:278)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)”
“ArgumentException: Getting control 0’s position in a group with only 0 controls when doing repaint
Aborting
UnityEngine.GUILayoutGroup.GetNext () (at C:/buildslave/unity/build/Modules/IMGUI/LayoutGroup.cs:122)
UnityEngine.GUILayoutUtility.DoGetRect (System.Single minWidth, System.Single maxWidth, System.Single minHeight, System.Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[ ] options) (at C:/buildslave/unity/build/Modules/IMGUI/GUILayoutUtility.cs:464)
UnityEngine.GUILayoutUtility.GetRect (System.Single width, System.Single height, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[ ] options) (at C:/buildslave/unity/build/Modules/IMGUI/GUILayoutUtility.cs:441)
UnityEngine.GUILayout.Space (System.Single pixels) (at C:/buildslave/unity/build/Modules/IMGUI/GUILayout.cs:219)
UnityEditor.Editor.DrawHeader () (at C:/buildslave/unity/build/Editor/Mono/Inspector/Editor.cs:718)
UnityEditor.UIElements.EditorElement.DrawEditorLargeHeader (System.Boolean& wasVisible) (at C:/buildslave/unity/build/Editor/Mono/Inspector/EditorElement.cs:284)
UnityEditor.UIElements.EditorElement.DrawEditorHeader (UnityEngine.Object target, System.Boolean& wasVisible) (at C:/buildslave/unity/build/Editor/Mono/Inspector/EditorElement.cs:245)
UnityEditor.UIElements.EditorElement.HeaderOnGUI () (at C:/buildslave/unity/build/Editor/Mono/Inspector/EditorElement.cs:193)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:295)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:481)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent () (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:455)
UnityEngine.UIElements.UIR.ImmediateRenderer.Draw (UnityEngine.UIElements.UIR.DrawChainState dcs) (at C:/buildslave/unity/build/Modules/UIElements/Renderer/UIRenderer/UIRenderers.cs:447)
UnityEngine.UIElements.UIR.UIRenderDevice.ContinueChain (UnityEngine.UIElements.UIR.RendererBase head, UnityEngine.UIElements.UIR.DrawChainState dcs, System.Boolean outerChainsWithMeshRenderer) (at C:/buildslave/unity/build/Modules/UIElements/Renderer/UIRenderer/UIRenderDevice.cs:865)
UnityEngine.UIElements.UIR.ZoomPanRenderer.Draw (UnityEngine.UIElements.UIR.DrawChainState dcs) (at C:/buildslave/unity/build/Modules/UIElements/Renderer/UIRenderer/UIRenderers.cs:419)
UnityEngine.UIElements.UIR.UIRenderDevice.ContinueChain (UnityEngine.UIElements.UIR.RendererBase head, UnityEngine.UIElements.UIR.DrawChainState dcs, System.Boolean outerChainsWithMeshRenderer) (at C:/buildslave/unity/build/Modules/UIElements/Renderer/UIRenderer/UIRenderDevice.cs:865)
UnityEngine.UIElements.UIR.UIRenderDevice.DrawChain (UnityEngine.UIElements.UIR.RendererBase head, UnityEngine.Rect viewport, UnityEngine.Matrix4x4 projection, UnityEngine.Texture atlas) (at C:/buildslave/unity/build/Modules/UIElements/Renderer/UIRenderer/UIRenderDevice.cs:848)
UnityEngine.UIElements.UIRRepaintUpdater.DrawChain (UnityEngine.Rect topRect, UnityEngine.Matrix4x4 projection) (at C:/buildslave/unity/build/Modules/UIElements/Renderer/UIRRepaintUpdater.cs:218)
UnityEngine.UIElements.UIRRepaintUpdater.Update () (at C:/buildslave/unity/build/Modules/UIElements/Renderer/UIRRepaintUpdater.cs:190)
UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTree () (at C:/buildslave/unity/build/Modules/UIElements/VisualTreeUpdater.cs:70)
UnityEngine.UIElements.Panel.Repaint (UnityEngine.Event e) (at C:/buildslave/unity/build/Modules/UIElements/Panel.cs:589)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:240)
UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:78)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)”
Do you have any way of identifying what components are one the object in question? Probably one of them is screwy. Maybe have a look at the scene file with a text editor.
Yeah. I just have to reimport Cinemachine and it fixes itself until I hit play again.
This is what I see when it breaks
This is what it should look like. It only has 3 components other than transform.
Heres a video of what’s happening after I reimport.
I think I managed to fix it. You were right. The post-processing component was the culprit. I removed it and added a new one and now it works. Thank you for your help.
Interesting. This might be related to a bug in Unity 2019, to do with conditionally-compiled scripts.
CinemachinePostProcessing.cs is a conditionally-compiled script.
If the issue returns, you can try this: edit CinemachinePostProcessing.cs, and remove the conditional ifdef at the top.