error ItemBuilder.cs:116

Absent83

Member
Please check one more error during item building.
This error appears after several character and item build and destroy operations.

[Exception] IndexOutOfRangeException: Array index is out of range.
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.


ItemBuilder.BuildItem() Assets/Opsive/UltimateCharacterController/Scripts/Utility/Builders/ItemBuilder.cs:116
114: if (itemSetManager != null && itemType.CategoryIndices != null) {
115: for (int i = 0; i < itemType.CategoryIndices.Length; ++i) {
-->116: var category = itemSetManager.CategoryItemSets;
117: hasItemType = false;
118: for (int j = 0; j < category.ItemSetList.Count; ++j) {


ItemManager.DrawNewItem() Assets/Opsive/UltimateCharacterController/Editor/Managers/ItemManager.cs:265
263: GUI.enabled = canBuild;
264: if (GUILayout.Button("Build Item")) {
-->265: var item = ItemBuilder.BuildItem(m_Name, m_ItemType, m_AnimatorItemID, m_Character, m_SlotID, m_AddToDefaultLoadout, m_FirstPersonObject, m_FirstPersonObjectAnimatorController,
266: m_FirstPersonVisibleItem, m_FirstPersonItemSlot, m_FirstPersonVisibleItemAnimatorController, m_ThirdPersonObject, m_ThirdPersonItemSlot, m_ThirdPersonObjectAnimatorController,
267: m_InvisibleShadowCaster, m_ActionType, m_ActionItemType);


ItemManager.OnGUI() Assets/Opsive/UltimateCharacterController/Editor/Managers/ItemManager.cs:109
107: if (m_DrawNewItems) {
108: GUILayout.Label("New Item", InspectorUtility.CenterBoldLabel);
-->109: DrawNewItem();
110: } else {
111: GUILayout.Label("Existing Item", InspectorUtility.CenterBoldLabel);


MainManagerWindow.OnManagerGUI() Assets/Opsive/UltimateCharacterController/Editor/Managers/MainManagerWindow.cs:407
405: GUILayout.Label(m_ManagerNames[m_MenuSelection], ManagerTitle);
406: GUILayout.Space(2);
-->407: m_Managers[m_MenuSelection].OnGUI();
408: GUILayout.EndArea();
409: }


MainManagerWindow.OnGUI() Assets/Opsive/UltimateCharacterController/Editor/Managers/MainManagerWindow.cs:310
309: // Draw the manager.
-->310: OnManagerGUI();
312: // Use a custom serialization for any changes since Unity's serialization doesn't support abstract inheritance.


MonoMethod.Invoke() /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222

MonoMethod.Invoke() /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232

MethodBase.Invoke() /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115

HostView.Invoke() C:/buildslave/unity/build/Editor/Mono/HostView.cs:295

HostView.Invoke() C:/buildslave/unity/build/Editor/Mono/HostView.cs:288

HostView.InvokeOnGUI() C:/buildslave/unity/build/Editor/Mono/HostView.cs:255
 
Last edited:
video:


I think that this error appears after deleting GameObject of the character within items (or maybe scene with character) and generating character and items again (maybe in new scene).
 
Last edited:
Instead of deleting the items GameObjects you should remove it from the Existing Item tab of the Item Manager. This will ensure all references are cleaned up.
 
How is it correctly to delete character?

If I delete all items and then delete character, and make it all again this error appears :(
 
Top