IndexOutOfRangeException: Array index is out of range.

Major bug popping up. I just updated to 4.1.5f1 and cannot use anything now. Clicking anywhere on the editor is generating massive Index and OnGUI errors.

IndexOutOfRangeException: Array index is out of range.

The targets array should not be used inside OnSceneGUI or OnPreviewGUI. Use the single target property instead.
UnityEditor.DockArea:OnGUI()

Any thoughts? The previous version was working fine - this is brand new.

I’m running Windows 7 Home, i3 2.20 quad core with 4GB RAM.

The error message has usually more information pointing you to the place where the issue occurred. No one will be able to help without that information.

Whoops, here are the error messages in full

IndexOutOfRangeException: Array index is out of range.
UnityEditor.GameView.GetGameViewRect (Rect position, Int32 aspectRatio, UnityEngine.Rect entireGameViewRect, UnityEngine.Rect localRect) (at C:/BuildAgent/work/7535de4ca26c26ac/Editor/Mono/GameView/GameView.cs:574)
UnityEditor.GameView.GetSize () (at C:/BuildAgent/work/7535de4ca26c26ac/Editor/Mono/GameView/GameView.cs:461)
UnityEditor.GameView.GetSizeOfMainGameView () (at C:/BuildAgent/work/7535de4ca26c26ac/Editor/Mono/GameView/GameView.cs:224)
UnityEditor.CameraEditor.GetGameViewAspectRatio (UnityEngine.Camera fallbackCamera) (at C:/BuildAgent/work/7535de4ca26c26ac/Editor/Mono/Inspector/CameraEditor.cs:201)
UnityEditor.CameraEditor.GetFrustrum (UnityEngine.Camera camera, UnityEngine.Vector3[ ] near, UnityEngine.Vector3[ ] far, System.Single aspectGameView) (at C:/BuildAgent/work/7535de4ca26c26ac/Editor/Mono/Inspector/CameraEditor.cs:216)
UnityEditor.CameraEditor.OnSceneGUI () (at C:/BuildAgent/work/7535de4ca26c26ac/Editor/Mono/Inspector/CameraEditor.cs:316)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) (at /Applications/buildAgent/work/84669f285f6a667f/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) (at /Applications/buildAgent/work/84669f285f6a667f/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[ ] parameters) (at /Applications/buildAgent/work/84669f285f6a667f/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.SceneView.CallOnSceneGUI () (at C:/BuildAgent/work/7535de4ca26c26ac/Editor/Mono/SceneView/SceneView.cs:1346)
UnityEditor.SceneView.HandleSelectionAndOnSceneGUI () (at C:/BuildAgent/work/7535de4ca26c26ac/Editor/Mono/SceneView/SceneView.cs:850)
UnityEditor.SceneView.OnGUI () (at C:/BuildAgent/work/7535de4ca26c26ac/Editor/Mono/SceneView/SceneView.cs:739)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) (at /Applications/buildAgent/work/84669f285f6a667f/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

The targets array should not be used inside OnSceneGUI or OnPreviewGUI. Use the single target property instead.
UnityEditor.DockArea:OnGUI()

Unity itself acts fine until I so much as click anywhere within the editor, then it starts screaming errors at me.

That looks like a bug. Maybe it is a side effect of something in your project. Nevertheless, it still looks like a bug to me and you should report it.

Reported already. I’d defiantly say it’s a bug of the new update. The project is empty except for a few models imported.
This new update seems to be full of bugs based on the forum over the past day and a half. Strange that most of them weren’t
caught.

Okay… so I’m still experiencing this bug. I downgraded to a older version, tried a test folder with NO extras, and getting the same result… as far as 4.0.0 goes it seems to be broken and nothing I’m doing is fixing it. Does anyone have any clues?

Note: I completely uninstalled and reinstalled Unity as well before downgrading to the older 4.1.2 version.

I’m using 3.5.6f4 and I’m getting the same problem when I create a new project. Already existing projects work fine though. I THINK it is when the editor is trying to draw the camera’s preview window, because it’s only showing up when I interact with the camera… but unfortunately that’s all I’ve got

Yea, I’m NOT getting that issue if I interact with the camera while the Game Tab is selected, and when I’m in the scene tab that issue occurs and the Game Preview window fails to appear

Ok, I got the problem to go away, but it’s an odd solution: I just selected the Game tab and moved the camera around using the inspector transform inputs… and when I went back to the Scene Tab it stopped giving that error and started correctly displaying the Game Preview again. I’m not sure what caused it (since all of the error messages link to unnamed hidden objects in the inspector), or how that fixed it, but I hope it help!