Forum rules - please read before posting.

Tutorial issue - Multiple errors in play mode

I am currently working through the Adventure Creator: Recreating Unity's adventure game tutorial and I have just been adding the trigger from the security room to switch scenes to the market. It was all working fine and then I went to the market scene and added the player start at the door with the fade in. After this , I went back to the security room to test and it instantly paused play mode and came up with a whole host of errors , none of which I have a clue about :

ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced.
0x00007FF7C522496C (Unity) StackWalker::GetCurrentCallstack

I tried disabling both the trigger in the security room and the player start in the market as they were that last thing I changed, but the errors still persist.
Can anybody help me here, as far as I can see it is nothing I have done so I have no idea how to fix it and googling the errors just comes up with advice on incorrect scripts/coding that I am clueless about.
Thanks.

Comments

  • Often there'll be more to these errors when you select them in the Console window. The lines that follow will reveal more about exactly where things are coming from.

    Please share the error messages in full, and also let me know both your AC and Unity version numbers.

  • Thanks Chris.
    Weirdly enough , even though last night I closed Unity and re-opened it to see if the error persisted - which it did , I have just opened it and it is if it has not saved. The scene has reverted back to just before I added the trigger in and is now working fine again. Not sure how because as I say, I closed Unity and re-opened it and it had definitely saved it at the point where the errors were - but now the save is back before that..... very strange.
    Anyway , I will again add the trigger in to switch scene and if the errors re appear i will post the details that you asked for here.
    Thanks again.

  • @ChrisIceBox , the issue appeared again. I restarted the tutorial and this time I managed to get the scene transitions working fine , but then I added a player start in the security room for the player to appear at when coming from the market and it happened. I deleted the player start (which was the only thing I had done in that scene since loading it) but the issue still happens.
    I am using Unity 2019.2.17f1 and AC version 1.69.5
    Here is the full error list that comes up :

    ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index
    System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <567df3e0919241ba98db88bec4c6696f>:0)
    System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <567df3e0919241ba98db88bec4c6696f>:0)
    System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <567df3e0919241ba98db88bec4c6696f>:0)
    AC.SceneManager.GetActiveScenePrefab () (at Assets/AdventureCreator/Scripts/Managers/SceneManager.cs:978)
    AC.SceneManager.GetPrefabsInScene () (at Assets/AdventureCreator/Scripts/Managers/SceneManager.cs:1321)
    AC.SceneManager.ListPrefabs () (at Assets/AdventureCreator/Scripts/Managers/SceneManager.cs:987)
    AC.SceneManager.ShowSettingsGUI () (at Assets/AdventureCreator/Scripts/Managers/SceneManager.cs:457)
    AC.SceneManager.ShowGUI () (at Assets/AdventureCreator/Scripts/Managers/SceneManager.cs:79)
    AC.AdventureCreator.OnGUI () (at Assets/AdventureCreator/Scripts/Managers/Editor/AdventureCreator.cs:140)
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <567df3e0919241ba98db88bec4c6696f>:0)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <567df3e0919241ba98db88bec4c6696f>:0)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <567df3e0919241ba98db88bec4c6696f>:0)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:359)
    UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:353)
    UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:329)
    UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect, System.Boolean floatingWindow, System.Boolean isBottomTab) (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:374)
    UnityEditor.DockArea.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:341)
    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:281)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

    GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced.
    0x00007FF7C522496C (Unity) StackWalker::GetCurrentCallstack
    0x00007FF7C5227E41 (Unity) StackWalker::ShowCallstack
    0x00007FF7C3AB5E55 (Unity) GetStacktrace
    0x00007FF7C5DDDCCB (Unity) DebugStringToFile
    0x00007FF7C5258DF4 (Unity) DebugLogHandler_CUSTOM_Internal_Log
    0x000002559F00E9BB (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
    0x000002559F00E5EB (Mono JIT Code) [DebugLogHandler.cs:10] UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    0x00000255A45B20D1 (Mono JIT Code) [Logger.cs:61] UnityEngine.Logger:Log (UnityEngine.LogType,object)
    0x00000255A45B1E0D (Mono JIT Code) [Debug.bindings.cs:127] UnityEngine.Debug:LogError (object)
    0x000002559ECBD973 (Mono JIT Code) [IMGUIContainer.cs:407] UnityEngine.UIElements.IMGUIContainer:DoOnGUI (UnityEngine.Event,UnityEngine.Matrix4x4,UnityEngine.Rect,bool,UnityEngine.Rect)
    0x000002559ECB9943 (Mono JIT Code) [IMGUIContainer.cs:482] UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent (UnityEngine.Event,UnityEngine.Matrix4x4,UnityEngine.Rect)
    0x00000255A44FB513 (Mono JIT Code) [IMGUIContainer.cs:458] UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent ()
    0x00000255A44F7382 (Mono JIT Code) [UIRenderers.cs:113] UnityEngine.UIElements.UIR.RenderChainCommand:ExecuteNonDrawMesh (UnityEngine.UIElements.UIR.DrawParams,bool,System.Exception&)
    0x00000255A44F1E53 (Mono JIT Code) [UIRenderDevice.cs:887] UnityEngine.UIElements.UIR.UIRenderDevice:EvaluateChain (UnityEngine.UIElements.UIR.RenderChainCommand,UnityEngine.Rect,UnityEngine.Matrix4x4,UnityEngine.Texture,System.Exception&)
    0x00000255A44EABA3 (Mono JIT Code) [UIRenderDevice.cs:988] UnityEngine.UIElements.UIR.UIRenderDevice:DrawChain (UnityEngine.UIElements.UIR.RenderChainCommand,UnityEngine.Rect,UnityEngine.Matrix4x4,UnityEngine.Texture,System.Exception&)
    0x00000255A44AF9A3 (Mono JIT Code) [UIRChainBuilder.cs:235] UnityEngine.UIElements.UIR.RenderChain:Render (UnityEngine.Rect,UnityEngine.Matrix4x4)
    0x00000255A44ADD03 (Mono JIT Code) [UIRRepaintUpdater.cs:67] UnityEngine.UIElements.UIRRepaintUpdater:DrawChain (UnityEngine.Rect,UnityEngine.Matrix4x4)
    0x00000255A44AD7E0 (Mono JIT Code) [UIRRepaintUpdater.cs:55] UnityEngine.UIElements.UIRRepaintUpdater:Update ()
    0x00000255A44CE3F1 (Mono JIT Code) [VisualTreeUpdater.cs:73] UnityEngine.UIElements.VisualTreeUpdater:UpdateVisualTree ()
    0x00000255A44CDDF3 (Mono JIT Code) [Panel.cs:638] UnityEngine.UIElements.Panel:Repaint (UnityEngine.Event)
    0x000002559EC895E3 (Mono JIT Code) [UIElementsUtility.cs:246] UnityEngine.UIElements.UIElementsUtility:DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel)
    0x000002559EC8912B (Mono JIT Code) [UIElementsUtility.cs:78] UnityEngine.UIElements.UIElementsUtility:ProcessEvent (int,intptr)
    0x000002559EC88A8E (Mono JIT Code) [GUIUtility.cs:179] UnityEngine.GUIUtility:ProcessEvent (int,intptr)
    0x000002559EC88CB3 (Mono JIT Code) (wrapper runtime-invoke) :runtime_invoke_bool_int_intptr (object,intptr,intptr,intptr)
    0x00007FFF1505BFB0 (mono-2.0-bdwgc) [mini-runtime.c:2809] mono_jit_runtime_invoke
    0x00007FFF14FE2142 (mono-2.0-bdwgc) [object.c:2921] do_runtime_invoke
    0x00007FFF14FEB13F (mono-2.0-bdwgc) [object.c:2968] mono_runtime_invoke
    0x00007FF7C51AEB92 (Unity) scripting_method_invoke
    0x00007FF7C51A8841 (Unity) ScriptingInvocation::Invoke
    0x00007FF7C51A2A9A (Unity) ScriptingInvocation::Invoke
    0x00007FF7C26DF949 (Unity) Scripting::UnityEngine::GUIUtilityProxy::ProcessEvent
    0x00007FF7C315A32C (Unity) GUIView::ProcessRetainedMode
    0x00007FF7C3ADCE17 (Unity) GUIView::OnInputEvent
    0x00007FF7C315A23C (Unity) GUIView::ProcessInputEvent
    0x00007FF7C3ACCFB7 (Unity) GUIView::DoPaint
    0x00007FF7C3ADF7FD (Unity) GUIView::RepaintAll
    0x00007FF7C322A2A2 (Unity) PlayerLoopController::UpdateScene
    0x00007FF7C3211B0E (Unity) PlayerLoopController::EnterPlayMode
    0x00007FF7C3224FED (Unity) PlayerLoopController::SetIsPlaying
    0x00007FF7C3227F47 (Unity) Application::TickTimer
    0x00007FF7C3ABD370 (Unity) MainMessageLoop
    0x00007FF7C3ABFD8F (Unity) WinMain
    0x00007FF7C67788D2 (Unity) __scrt_common_main_seh
    0x00007FFF7CF87BD4 (KERNEL32) BaseThreadInitThunk
    0x00007FFF7DA8CED1 (ntdll) RtlUserThreadStart

  • ArgumentException: Getting control 34's position in a group with only 34 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) (at C:/buildslave/unity/build/Modules/IMGUI/GUILayoutUtility.cs:436)
    UnityEditor.EditorGUILayout.Space () (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:8974)
    AC.CustomGUILayout.ToggleHeader (System.Boolean toggle, System.String label, System.Boolean spaceAbove) (at Assets/AdventureCreator/Scripts/Static/CustomGUILayout.cs:230)
    AC.SceneManager.ListPrefabs () (at Assets/AdventureCreator/Scripts/Managers/SceneManager.cs:990)
    AC.SceneManager.ShowSettingsGUI () (at Assets/AdventureCreator/Scripts/Managers/SceneManager.cs:457)
    AC.SceneManager.ShowGUI () (at Assets/AdventureCreator/Scripts/Managers/SceneManager.cs:79)
    AC.AdventureCreator.OnGUI () (at Assets/AdventureCreator/Scripts/Managers/Editor/AdventureCreator.cs:140)
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <567df3e0919241ba98db88bec4c6696f>:0)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    UnityEngine.UIElements.UIR.RenderChain.Render (UnityEngine.Rect topRect, UnityEngine.Matrix4x4 projection) (at C:/buildslave/unity/build/Modules/UIElements/Renderer/UIRChainBuilder.cs:238)
    UnityEngine.UIElements.UIRRepaintUpdater.DrawChain (UnityEngine.Rect topRect, UnityEngine.Matrix4x4 projection) (at C:/buildslave/unity/build/Modules/UIElements/Renderer/UIRRepaintUpdater.cs:66)
    UnityEngine.UIElements.UIRRepaintUpdater.Update () (at C:/buildslave/unity/build/Modules/UIElements/Renderer/UIRRepaintUpdater.cs:54)
    UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTree () (at C:/buildslave/unity/build/Modules/UIElements/VisualTreeUpdater.cs:72)
    UnityEngine.UIElements.Panel.Repaint (UnityEngine.Event e) (at C:/buildslave/unity/build/Modules/UIElements/Panel.cs:637)
    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)

    ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index
    System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <567df3e0919241ba98db88bec4c6696f>:0)
    System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <567df3e0919241ba98db88bec4c6696f>:0)
    System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <567df3e0919241ba98db88bec4c6696f>:0)
    AC.SceneManager.GetActiveScenePrefab () (at Assets/AdventureCreator/Scripts/Managers/SceneManager.cs:978)
    AC.SceneManager.ListPrefabs () (at Assets/AdventureCreator/Scripts/Managers/SceneManager.cs:996)
    AC.SceneManager.ShowSettingsGUI () (at Assets/AdventureCreator/Scripts/Managers/SceneManager.cs:457)
    AC.SceneManager.ShowGUI () (at Assets/AdventureCreator/Scripts/Managers/SceneManager.cs:79)
    AC.AdventureCreator.OnGUI () (at Assets/AdventureCreator/Scripts/Managers/Editor/AdventureCreator.cs:140)
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <567df3e0919241ba98db88bec4c6696f>:0)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <567df3e0919241ba98db88bec4c6696f>:0)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <567df3e0919241ba98db88bec4c6696f>:0)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:359)
    UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:353)
    UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:329)
    UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect, System.Boolean floatingWindow, System.Boolean isBottomTab) (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:374)
    UnityEditor.DockArea.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:341)
    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:281)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

  • Sorry , I ran out of characters so had to post several posts. Interestingly , if you enter play mode from the market scene , you can go in and out of the security room fine, it is only when entering playmode from the security room that the issue occurs - I would have thought that entering the security room from the market would also cause the issue as it seems to be that scene that is the issue?

  • Though I can't reproduce such an issue, these look to be related to the Scene Manager. I wonder - if you close the AC Game Editor - or switch to another Manager tab - does the issue go away?

    You're not using the latest release (v1.70) - what are you using?

    Try this potential fix. Open up the script file /Assets/AdventureCreator/Scripts/Managers/SceneManager.cs, and search for the line:

    if (scenePrefabs.Count < activeScenePrefab)
    

    Replace it with:

    if (scenePrefabs.Count <= activeScenePrefab)
    

    Does that solve the issue?

  • The issue does go away if I restart the computer. It seems to be a matter of time rather than specifically doing anything to cause the issue because both times It has happened , I have been at different stages of the tutorial.
    I am currently rendering out a large animation for my game on Blender which is using all four of my GPU's all day and I was wondering whether perhaps that was causing it in a similar way that your VRAM eventually gets used up when rendering in Blender?
    Interestingly enough , I have left the scene open overnight in Unity whilst Blender has been rendering , and I have just tried going into playmode just now from the Security Room and it works fine again.
    I assume it will do it again and when it does I will try your fix and let you know if it worked.
    Thanks again for the help.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.