Integration issue with The ultimate inventory system

secretlabs

New member
So i make a new project and imported the inventory system, The controller system and the dialog system. Everything is working well except when i try to add a binding to my weapons for the damage function/ Use the damage from the inventory item database. when i try to do this the Ui in the inspector just boots me out of the script itself and occasionally bugs the inventory on the player and makes the whole script component disappear. needless to say i cannot add bindings! I have been following along in the tutorial videos provided, I'm exactly where we need to add bindings and I'm stuck! The error is so large i cannot add it all to this post!

NullReferenceException: Object reference not set to an instance of an object.
UnityEngine.Bindings.ThrowHelper.ThrowNullReferenceException (System.Object obj) (at <4d55ab038a5f4117a0dc489fc0160902>:0)
UnityEditor.SerializedObject.get_targetObject () (at <83b0917d7d7a474c956c0331fad2895c>:0)
Opsive.Shared.Editor.UIElements.UIElementsUtility+<>c__DisplayClass5_0.<CreateUIElementInspectorGUI>b__0 (System.Object obj) (at <caa7e67f8ade47358637818642d6931a>:0)
Opsive.Shared.Editor.UIElements.FieldInspectorView+<>c__DisplayClass8_0.<AddField>b__0 (System.Object value) (at <caa7e67f8ade47358637818642d6931a>:0)
Opsive.Shared.Editor.UIElements.FieldInspectorView+<>c__DisplayClass14_0.<AddSingleField>b__1 (System.Object changedValue) (at <caa7e67f8ade47358637818642d6931a>:0)
Opsive.UltimateCharacterController.Editor.Controls.CharacterItemActionModuleGroupBaseControl+<>c__DisplayClass3_0.<GetControl>b__0 (Opsive.UltimateCharacterController.Items.Actions.Modules.ActionModuleGroupBase newValue) (at ./Packages/com.opsive.ultimatecharactercontroller/Editor/Controls/Types/CharacterItemActionModuleGroupBaseControl.cs:58)
Opsive.UltimateCharacterController.Editor.Inspectors.Items.Actions.CharacterItemActionModuleGroupField.InvokeValueChanged (System.Boolean refresh) (at ./Packages/com.opsive.ultimatecharactercontroller/Editor/Inspectors/Items/Actions/CharacterItemActionInspector.cs:278)
Opsive.UltimateCharacterController.Editor.Inspectors.Items.Actions.CharacterItemActionModuleGroupField+<>c__DisplayClass7_0.<DrawModule>b__0 (System.Object obj) (at ./Packages/com.opsive.ultimatecharactercontroller/Editor/Inspectors/Items/Actions/CharacterItemActionInspector.cs:237)
Opsive.Shared.Editor.UIElements.FieldInspectorView+<>c__DisplayClass4_0.<AddFields>b__0 (System.Object value) (at <caa7e67f8ade47358637818642d6931a>:0)
Opsive.UltimateCharacterController.Editor.Controls.Types.BoundStateObjectControlType+<>c__DisplayClass1_0.<GetHeaderControl>b__1 (System.Object o) (at ./Packages/com.opsive.ultimatecharactercontroller/Editor/Controls/Types/BoundStateObjectControl.cs:90)
Opsive.Shared.Editor.UIElements.FieldInspectorView+<>c__DisplayClass8_0.<AddField>b__0 (System.Object value) (at <caa7e67f8ade47358637818642d6931a>:0)
Opsive.Shared.Editor.UIElements.FieldInspectorView+<>c__DisplayClass14_0.<AddSingleField>b__1 (System.Object changedValue) (at <caa7e67f8ade47358637818642d6931a>:0)
Opsive.UltimateCharacterController.Editor.Controls.Types.ImpactActionGroupControlType+<>c__DisplayClass2_0.<GetControl>b__0 (Opsive.UltimateCharacterController.Items.Actions.Impact.ImpactActionGroup newValue) (at ./Packages/com.opsive.ultimatecharactercontroller/Editor/Controls/Types/ImpactActionGroupControl.cs:49)
Opsive.UltimateCharacterController.Editor.Controls.Types.ImpactActionGroupField.Set (System.Collections.Generic.IList`1[T] actions) (at ./Packages/com.opsive.ultimatecharactercontroller/Editor/Controls/Types/ImpactActionGroupControl.cs:128)
Opsive.UltimateCharacterController.Editor.Inspectors.Items.Actions.GenericReorderableList`1[T].InvokeValueChanged (System.Boolean refresh) (at ./Packages/com.opsive.ultimatecharactercontroller/Editor/Inspectors/Items/Actions/GenericReorderableList.cs:239)
Opsive.UltimateCharacterController.Editor.Inspectors.Items.Actions.GenericReorderableList`1+<>c__DisplayClass13_0[T].<DrawModule>b__0 (System.Object obj) (at ./Packages/com.opsive.ultimatecharactercontroller/Editor/Inspectors/Items/Actions/GenericReorderableList.cs:214)
Opsive.Shared.Editor.UIElements.FieldInspectorView+<>c__DisplayClass4_0.<AddFields>b__0 (System.Object value) (at <caa7e67f8ade47358637818642d6931a>:0)
Opsive.UltimateCharacterController.Editor.Controls.Types.BoundStateObjectControlType+<>c__DisplayClass0_0.<GetControl>b__0 (System.Object o) (at ./Packages/com.opsive.ultimatecharactercontroller/Editor/Controls/Types/BoundStateObjectControl.cs:43)
Opsive.Shared.Editor.UIElements.FieldInspectorView+<>c__DisplayClass8_0.<AddField>b__0 (System.Object value) (at <caa7e67f8ade47358637818642d6931a>:0)
Opsive.Shared.Editor.UIElements.FieldInspectorView+<>c__DisplayClass14_0.<AddSingleField>b__1 (System.Object changedValue) (at <caa7e67f8ade47358637818642d6931a>:0)
Opsive.UltimateCharacterController.Editor.Controls.Types.StateObjectBindingGroupControlType+<>c__DisplayClass2_0.<GetControl>b__0 (Opsive.UltimateCharacterController.Items.Actions.Bindings.StateObjectBindingGroup newValue) (at ./Packages/com.opsive.ultimatecharactercontroller/Editor/Controls/Types/StateObjectBindingGroupControl.cs:47)
Opsive.UltimateCharacterController.Editor.Controls.Types.StateObjectBindingGroupField.Set (System.Collections.Generic.IList`1[T] bindings) (at ./Packages/com.opsive.ultimatecharactercontroller/Editor/Controls/Types/StateObjectBindingGroupControl.cs:127)
Opsive.UltimateCharacterController.Editor.Inspectors.Items.Actions.GenericReorderableList`1[T].InvokeValueChanged (System.Boolean refresh) (at ./Packages/com.opsive.ultimatecharactercontroller/Editor/Inspectors/Items/Actions/GenericReorderableList.cs:239)
Opsive.UltimateCharacterController.Editor.Inspectors.Items.Actions.GenericReorderableList`1+<>c__DisplayClass13_0[T].<DrawModule>b__0 (System.Object obj) (at ./Packages/com.opsive.ultimatecharactercontroller/Editor/Inspectors/Items/Actions/GenericReorderableList.cs:214)
Opsive.Shared.Editor.UIElements.FieldInspectorView+<>c__DisplayClass4_0.<AddFields>b__0 (System.Object value) (at <caa7e67f8ade47358637818642d6931a>:0)
Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.Editor.ItemObjectBindingControl+<>c__DisplayClass0_0.<CreateCustomControlVisualElement>b__0 (Opsive.UltimateInventorySystem.Core.ItemCategory newCategory) (at Assets/Opsive/Opsive Ultimate Character Controller/Integrations/UltimateInventorySystem/Editor/InventoryItemBindingControl.cs:69)
Opsive.UltimateInventorySystem.Editor.Inspectors.ItemCategoryAttributeBindingView.<.ctor>b__19_0 (Opsive.UltimateInventorySystem.Core.ItemCategory x) (at ./Packages/com.opsive.ultimateinventorysystem/Editor/Inspectors/ItemCategoryAttributeBindingView.cs:72)
Opsive.UltimateInventorySystem.Editor.VisualElements.InventoryObjectSearchableListWindow`1[T].InvokeAction (System.Int32 index) (at ./Packages/com.opsive.ultimateinventorysystem/Editor/VisualElements/InventoryObjectSearchableListWindow.cs:128)
Opsive.UltimateInventorySystem.Editor.VisualElements.InventoryObjectSearchableListWindow`1+<>c__DisplayClass28_0[T].<BuildPopupContent>b__0 (System.Int32 index) (at ./Packages/com.opsive.ultimateinventorysystem/Editor/VisualElements/InventoryObjectSearchableListWindow.cs:111)
Opsive.UltimateInventorySystem.Editor.VisualElements.SearchableList`1[T].<.ctor>b__28_4 (System.Int32 index) (at ./Packages/com.opsive.ultimateinventorysystem/Editor/VisualElements/SearchableList.cs:175)
Opsive.Shared.Editor.UIElements.ReorderableList.SelectItem (System.Int32 index) (at <caa7e67f8ade47358637818642d6931a>:0)
Opsive.Shared.Editor.UIElements.ReorderableList.MouseDown (Opsive.Shared.Editor.UIElements.ReorderableList+ListItem item) (at <caa7e67f8ade47358637818642d6931a>:0)
 
The rest of the Error
Opsive.Shared.Editor.UIElements.ReorderableList+ListItem.OnMouseDown (UnityEngine.UIElements.MouseDownEvent evt) (at &lt;caa7e67f8ade47358637818642d6931a&gt;:0)
UnityEngine.UIElements.EventCallbackFunctor`1[TEventType].Invoke (UnityEngine.UIElements.EventBase evt) (at &lt;2a2d93466686437ab24c9fdcfa07ab5c&gt;:0)
UnityEngine.UIElements.EventCallbackRegistry+DynamicCallbackList.Invoke (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.VisualElement target) (at &lt;2a2d93466686437ab24c9fdcfa07ab5c&gt;:0)
UnityEngine.UIElements.EventDispatchUtilities.HandleEventAcrossPropagationPathWithCompatibilityEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.EventBase compatibilityEvt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.VisualElement target, System.Boolean isCapturingTarget) (at &lt;2a2d93466686437ab24c9fdcfa07ab5c&gt;:0)
UnityEngine.UIElements.EventDispatchUtilities.DispatchToCachedElementUnderPointerOrPanelRoot (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, System.Int32 pointerId, UnityEngine.Vector2 position) (at &lt;2a2d93466686437ab24c9fdcfa07ab5c&gt;:0)
UnityEngine.UIElements.EventDispatchUtilities.DispatchToCapturingElementOrElementUnderPointer (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, System.Int32 pointerId, UnityEngine.Vector2 position) (at &lt;2a2d93466686437ab24c9fdcfa07ab5c&gt;:0)
UnityEngine.UIElements.PointerEventBase`1[T].Dispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at &lt;2a2d93466686437ab24c9fdcfa07ab5c&gt;:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at &lt;2a2d93466686437ab24c9fdcfa07ab5c&gt;:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at &lt;2a2d93466686437ab24c9fdcfa07ab5c&gt;:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at &lt;2a2d93466686437ab24c9fdcfa07ab5c&gt;:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at &lt;2a2d93466686437ab24c9fdcfa07ab5c&gt;:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean&amp; eventHandled) (at &lt;2a2d93466686437ab24c9fdcfa07ab5c&gt;:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at &lt;2a2d93466686437ab24c9fdcfa07ab5c&gt;:0)
UnityEngine.UIElements.UIEventRegistration+&lt;&gt;c.&lt;.cctor&gt;b__1_2 (System.Int32 i, System.IntPtr ptr) (at &lt;2a2d93466686437ab24c9fdcfa07ab5c&gt;:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean&amp; result) (at &lt;b2cdef22fe8a4b43bf30c26734e5040d&gt;:0)
 
Unfortunatly I'm unable to reproduce this error on my machine (using Unity 6000.0.24f1)

I was able to succesfully add an ItemObjectBinding to my ImpactActions Simple Damager, and set the DamageAmount to the DamageAmount item attribute. I tested this on the melee Action of the AssaultRifleWeapon Variant from the integration demo sample.

What Unity version are you using?
Are you able to give me some reproduction steps I can follow to get the error?

The error you pasted happens inside the UnityEngine codebase, so I can't "fix it" but in any case I will double check the code and take a look at the functions in the stack before the error happened to see if I can try to mitigate the error from happening.
 
So the error persisted all day yesterday, i took a break and got back to it today and it was gone XD absolutely no clue how it happened but i guarantee you its a user error issue. Gotta love Tweaking code.
 
Back
Top