Upgrade to 2021.2.6f1 and Odin raising IndexOutOfRangeException: Index was outside the bounds of the array. when selecting with circle

Issue #828 new
Matthew Waring created an issue

Had ODIN working fine in a 2020 project, upgraded project to 2021 and when clicking any of these circles causes:

IndexOutOfRangeException: Index was outside the bounds of the array.

  • I have tried deleting the ODIN directory and reinstalling the latest version of ODIN to no avail.
  • I have noticed that when opening the project clean and before the first RUN of the project, the selection works and shows the asset / scene popup?
  • I have no idea how to reproduce as of yet, but hoping the stack trace will ring a bell for development.

Here is a stack trace

Thanks for your help, love Odin, but can't continue with project as is :(

IndexOutOfRangeException: Index was outside the bounds of the array.

[Exception] IndexOutOfRangeException: Index was outside the bounds of the array.

ObjectSelector.Show() at /Users/bokken/buildslave/unity/build/Editor/Mono/ObjectSelector.cs:471

EditorGUI.DoObjectField() at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/ObjectField.cs:273

EditorGUI.DoObjectField() at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/ObjectField.cs:157

EditorGUI.DoObjectField() at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/ObjectField.cs:27

EditorGUI.ObjectField() at /Users/bokken/buildslave/unity/build/Editor/Mono/EditorGUI.cs:4151

SirenixEditorFields.UnityObjectField() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.Utilities.Editor/GUI/SirenixEditorFields.cs:104

SirenixEditorFields.UnityObjectField() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.Utilities.Editor/GUI/SirenixEditorFields.cs:154

Sirenix.OdinInspector.Editor.Drawers.UnityObjectDrawer`1[T].DrawPropertyLayout() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Value Drawers/UnityObjectDrawer.cs:75

OdinDrawer.CallNextDrawer() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinDrawer.cs:155

TooltipAttributeDrawer.DrawPropertyLayout() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Attribute Drawers/TooltipAttributeDrawer.cs:42

OdinDrawer.CallNextDrawer() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinDrawer.cs:155

Sirenix.OdinInspector.Editor.Drawers.PropertyContextMenuDrawer`1[T].DrawPropertyLayout() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Misc Drawers/PropertyContextMenuDrawer.cs:659

OdinDrawer.DrawProperty() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinDrawer.cs:109

InspectorProperty.Draw() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:831

InspectorProperty.Draw() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:908

CompositeDrawer.DrawPropertyLayout() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Value Drawers/CompositeDrawer.cs:89

OdinDrawer.CallNextDrawer() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinDrawer.cs:155

NullableReferenceDrawer`1.DrawPropertyLayout() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Misc Drawers/NullableReferenceDrawer.cs:104

OdinDrawer.CallNextDrawer() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinDrawer.cs:155

FixUnityNullDrawer`1.DrawPropertyLayout() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Misc Drawers/FixUnityNullDrawer.cs:87

OdinDrawer.CallNextDrawer() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinDrawer.cs:155

ReferenceDrawer`1.DrawPropertyLayout() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Misc Drawers/ReferenceDrawer.cs:118

OdinDrawer.CallNextDrawer() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinDrawer.cs:155

PropertyContextMenuDrawer`1.DrawPropertyLayout() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Misc Drawers/PropertyContextMenuDrawer.cs:659

OdinDrawer.DrawProperty() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinDrawer.cs:109

InspectorProperty.Draw() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:831

CollectionDrawer`1.DrawItem() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Value Drawers/CollectionDrawer.cs:1398

CollectionDrawer`1.DrawItems() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Value Drawers/CollectionDrawer.cs:1199

CollectionDrawer`1.DrawPropertyLayout() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Value Drawers/CollectionDrawer.cs:644

OdinDrawer.CallNextDrawer() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinDrawer.cs:155

NullableReferenceDrawer`1.DrawPropertyLayout() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Misc Drawers/NullableReferenceDrawer.cs:104

OdinDrawer.CallNextDrawer() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinDrawer.cs:155

FixUnityNullDrawer`1.DrawPropertyLayout() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Misc Drawers/FixUnityNullDrawer.cs:87

OdinDrawer.CallNextDrawer() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinDrawer.cs:155

ReferenceDrawer`1.DrawPropertyLayout() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Misc Drawers/ReferenceDrawer.cs:118

OdinDrawer.CallNextDrawer() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinDrawer.cs:155

PropertyContextMenuDrawer`1.DrawPropertyLayout() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Misc Drawers/PropertyContextMenuDrawer.cs:659

OdinDrawer.DrawProperty() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinDrawer.cs:109

InspectorProperty.Draw() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:831

InspectorProperty.Draw() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:719

UnityObjectRootDrawer`1.DrawPropertyLayout() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Value Drawers/UnityObjectRootDrawer.cs:60

OdinDrawer.DrawProperty() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinDrawer.cs:109

InspectorProperty.Draw() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:831

PropertyTree.DrawProperties() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:499

PropertyTree.Draw() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:388

OdinEditor.DrawTree() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinEditor.cs:93

OdinEditor.DrawOdinInspector() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinEditor.cs:246

OdinEditor.OnInspectorGUI() at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinEditor.cs:85

GUIUtility.ProcessEvent() at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189

Comments (3)

  1. Tor Esa Vestergaard

    This issue does not reproduce in our projects. I’m afraid we’ll need a reproducing project or a set of steps to make it reproduce from scratch in a clean project before we can perhaps figure out what is going wrong inside of Unity there. Does it also reproduce for you in an empty project?

  2. Matthew Waring reporter

    I recreated a blank URP project in said Unity, installed ODIN and all was fine, so thought I will proceed that way with clean project.
    Also, of course this means no easy way to reproduce.

    I just spent a couple days merging my old code into it and forgot about ODIN issue until I clicked and boom here we are again.

    😞

    IndexOutOfRangeException: Index was outside the bounds of the array.
    (wrapper stelemref) System.Object.virt_stelemref_sealed_class(intptr,object)
    UnityEditor.ObjectSelector.Show (UnityEngine.Object obj, System.Type[] requiredTypes, UnityEngine.Object objectBeingEdited, System.Boolean allowSceneObjects, System.Collections.Generic.List1[T] allowedInstanceIDs, System.Action1[T] onObjectSelectorClosed, System.Action1[T] onObjectSelectedUpdated) (at /Users/bokken/buildslave/unity/build/Editor/Mono/ObjectSelector.cs:471) UnityEditor.EditorGUI.DoObjectField (UnityEngine.Rect position, UnityEngine.Rect dropRect, System.Int32 id, UnityEngine.Object obj, UnityEngine.Object objBeingEdited, System.Type objType, System.Type additionalType, UnityEditor.SerializedProperty property, UnityEditor.EditorGUI+ObjectFieldValidator validator, System.Boolean allowSceneObjects, UnityEngine.GUIStyle style) (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/ObjectField.cs:273) UnityEditor.EditorGUI.DoObjectField (UnityEngine.Rect position, UnityEngine.Rect dropRect, System.Int32 id, UnityEngine.Object obj, UnityEngine.Object objBeingEdited, System.Type objType, UnityEditor.SerializedProperty property, UnityEditor.EditorGUI+ObjectFieldValidator validator, System.Boolean allowSceneObjects, UnityEngine.GUIStyle style) (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/ObjectField.cs:157) UnityEditor.EditorGUI.DoObjectField (UnityEngine.Rect position, UnityEngine.Rect dropRect, System.Int32 id, UnityEngine.Object obj, UnityEngine.Object objBeingEdited, System.Type objType, UnityEditor.EditorGUI+ObjectFieldValidator validator, System.Boolean allowSceneObjects, UnityEngine.GUIStyle style) (at /Users/bokken/buildslave/unity/build/Editor/Mono/GUI/ObjectField.cs:27) UnityEditor.EditorGUI.ObjectField (UnityEngine.Rect position, UnityEngine.GUIContent label, UnityEngine.Object obj, System.Type objType, System.Boolean allowSceneObjects) (at /Users/bokken/buildslave/unity/build/Editor/Mono/EditorGUI.cs:4151) Sirenix.Utilities.Editor.SirenixEditorFields.UnityObjectField (UnityEngine.Rect rect, UnityEngine.GUIContent label, UnityEngine.Object value, System.Type objectType, System.Boolean allowSceneObjects) (at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.Utilities.Editor/GUI/SirenixEditorFields.cs:104) Sirenix.Utilities.Editor.SirenixEditorFields.UnityObjectField (UnityEngine.GUIContent label, UnityEngine.Object value, System.Type objectType, System.Boolean allowSceneObjects, UnityEngine.GUILayoutOption[] options) (at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.Utilities.Editor/GUI/SirenixEditorFields.cs:154) Sirenix.OdinInspector.Editor.Drawers.UnityObjectDrawer1[T].DrawPropertyLayout (UnityEngine.GUIContent label) (at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Value Drawers/UnityObjectDrawer.cs:75)
    Sirenix.OdinInspector.Editor.OdinDrawer.CallNextDrawer (UnityEngine.GUIContent label) (at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinDrawer.cs:155)
    Sirenix.OdinInspector.Editor.Drawers.PropertyContextMenuDrawer`1[T].DrawPropertyLayout (UnityEngine.GUIContent label) (at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Misc Drawers/PropertyContextMenuDrawer.cs:659)
    Sirenix.OdinInspector.Editor.OdinDrawer.DrawProperty (UnityEngine.GUIContent label) (at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinDrawer.cs:109)
    Sirenix.OdinInspector.Editor.InspectorProperty.Draw (UnityEngine.GUIContent defaultLabel) (at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:831)
    Rethrow as OdinPropertyException: This error occurred while being drawn by Odin.
    Current IMGUI event: mouseDown
    Odin Property Path: LeftJoystick
    Odin Drawer Chain:

    PropertyContextMenuDrawer<GameObject>
    UnityObjectDrawer<GameObject>
    CompositeDrawer.
    UnityEngine.Debug:LogException(Exception)
    Sirenix.OdinInspector.Editor.InspectorProperty:Draw(GUIContent) (at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:908)
    Sirenix.OdinInspector.Editor.InspectorProperty:Draw() (at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:719)
    Sirenix.OdinInspector.Editor.Drawers.UnityObjectRootDrawer1:DrawPropertyLayout(GUIContent) (at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/Value Drawers/UnityObjectRootDrawer.cs:60) Sirenix.OdinInspector.Editor.OdinDrawer:CallNextDrawer(GUIContent) (at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinDrawer.cs:155) Sirenix.OdinInspector.Editor.Drawers.FixBrokenUnityObjectWrapperDrawer1:DrawPropertyLayout(GUIContent) (at Assets/Plugins/Sirenix/Odin Inspector/Scripts/Editor/FixBrokenUnityObjectWrapperDrawer.cs:41)
    Sirenix.OdinInspector.Editor.OdinDrawer:DrawProperty(GUIContent) (at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinDrawer.cs:109)
    Sirenix.OdinInspector.Editor.InspectorProperty:Draw(GUIContent) (at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:831)
    Sirenix.OdinInspector.Editor.PropertyTree:DrawProperties() (at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:499)
    Sirenix.OdinInspector.Editor.PropertyTree:Draw(Boolean) (at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:388)
    Sirenix.OdinInspector.Editor.OdinEditor:DrawTree() (at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinEditor.cs:93)
    Sirenix.OdinInspector.Editor.OdinEditor:DrawOdinInspector() (at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinEditor.cs:246)
    Sirenix.OdinInspector.Editor.OdinEditor:OnInspectorGUI() (at Y:/Repositories/sirenix-development-framework/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinEditor.cs:85)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)

    Don't even know what to suggest, is there not a clue in the read out?

    Can I attach something to my project to get you some more details?

    Best

    Matt

  3. Log in to comment