UCC + UIS issue

wistyuki

New member
I'm showing this error when trying to pick up items. I'm also being prevented from equipping items already in my inventory. Forgive me if this is discussed elsewhere, I have not been able to find anything on this error.



NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateInventorySystem.UI.Monitors.InventoryMonitor.OnItemAmountAdded (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo addedItemInfo, Opsive.UltimateInventorySystem.Core.DataStructures.ItemStack newStack) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Monitors/InventoryMonitor.cs:296)
Opsive.Shared.Events.InvokableAction`2[T1,T2].Invoke (T1 arg1, T2 arg2) (at <6ee9d952a9384b4ea988fa1f7efc55d9>:0)
Opsive.Shared.Events.EventHandler.ExecuteEvent[T1,T2] (System.Object obj, System.String eventName, T1 arg1, T2 arg2) (at <6ee9d952a9384b4ea988fa1f7efc55d9>:0)
Opsive.UltimateInventorySystem.Core.InventoryCollections.ItemCollection.NotifyAdd (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo itemInfo, Opsive.UltimateInventorySystem.Core.DataStructures.ItemStack addedItemStack) (at Assets/Opsive/UltimateInventorySystem/Scripts/Core/InventoryCollections/ItemCollection.cs:453)
Opsive.UltimateInventorySystem.Core.InventoryCollections.ItemCollection.AddInternal (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo itemInfo, Opsive.UltimateInventorySystem.Core.DataStructures.ItemStack stackTarget, System.Boolean notifyAdd) (at Assets/Opsive/UltimateInventorySystem/Scripts/Core/InventoryCollections/ItemCollection.cs:436)
Opsive.UltimateInventorySystem.Core.InventoryCollections.ItemCollection.AddItem (Opsive.UltimateInventorySystem.Core.DataStructures.ItemInfo itemInfo, Opsive.UltimateInventorySystem.Core.DataStructures.ItemStack stackTarget) (at Assets/Opsive/UltimateInventorySystem/Scripts/Core/InventoryCollections/ItemCollection.cs:523)
Opsive.UltimateInventorySystem.DropsAndPickups.ItemPickup.TryAddItemToCollection (Opsive.UltimateInventorySystem.Core.InventoryCollections.ItemCollection itemCollection) (at Assets/Opsive/UltimateInventorySystem/Scripts/DropsAndPickups/ItemPickup.cs:113)
Opsive.UltimateInventorySystem.DropsAndPickups.ItemPickup.OnInteractInternal (Opsive.UltimateInventorySystem.Interactions.IInteractor interactor) (at Assets/Opsive/UltimateInventorySystem/Scripts/DropsAndPickups/ItemPickup.cs:95)
Opsive.UltimateInventorySystem.Interactions.InteractableBehavior.OnInteract (Opsive.UltimateInventorySystem.Interactions.IInteractor interactor) (at Assets/Opsive/UltimateInventorySystem/Scripts/Interactions/InteractableBehavior.cs:95)
Opsive.Shared.Events.InvokableAction`1[T1].Invoke (T1 arg1) (at <6ee9d952a9384b4ea988fa1f7efc55d9>:0)
Opsive.Shared.Events.EventHandler.ExecuteEvent[T1] (System.Object obj, System.String eventName, T1 arg1) (at <6ee9d952a9384b4ea988fa1f7efc55d9>:0)
Opsive.UltimateInventorySystem.Interactions.Interactable.Interact (Opsive.UltimateInventorySystem.Interactions.IInteractor interactor) (at Assets/Opsive/UltimateInventorySystem/Scripts/Interactions/Interactable.cs:180)
Opsive.UltimateInventorySystem.Interactions.Interactable.Select (Opsive.UltimateInventorySystem.Interactions.IInteractor interactor) (at Assets/Opsive/UltimateInventorySystem/Scripts/Interactions/Interactable.cs:149)
Opsive.UltimateInventorySystem.Interactions.InventoryInteractor.SetSelectedInteractable (Opsive.UltimateInventorySystem.Interactions.IInteractable interactable) (at Assets/Opsive/UltimateInventorySystem/Scripts/Interactions/InventoryInteractor.cs:173)
Opsive.UltimateInventorySystem.Interactions.InventoryInteractor.AddInteractable (Opsive.UltimateInventorySystem.Interactions.IInteractable interactable) (at Assets/Opsive/UltimateInventorySystem/Scripts/Interactions/InventoryInteractor.cs:138)
Opsive.UltimateInventorySystem.Interactions.Interactable.OnTriggerEnterInternal (UnityEngine.GameObject other) (at Assets/Opsive/UltimateInventorySystem/Scripts/Interactions/Interactable.cs:106)
Opsive.UltimateInventorySystem.Interactions.Interactable.OnTriggerEnter (UnityEngine.Collider other) (at Assets/Opsive/UltimateInventorySystem/Scripts/Interactions/Interactable.cs:64)
 
Your error line doesn't match anything on my project. It is possible there has been some changes since the last update (assuming you are using the latest UIS code)

If I had to guess I would say the issue is that the InventoryMonitor was not initialized before it started being used... which should never be the case.

Could you disable the InventoryMonitor and see if it still happens?
Also do send me a snipet of the function that doesn't work pointing out the line that causes the error to happen.
 
Got it, thank you. Somehow the item view for my inventory monitor was unassigned, I thought I already checked that. I appreciate your advice. Still don't equip body, but that seems to be unrelated now.
 
Top