Hey,
What I am trying to do is creating a potion that executes a specific script once upon use.
For example: Use potion -> add effect to camera.
However, I have absolutely no clue how to set this up. I've been messing around for hours with things in the UI Designer.
One of these is going to UI designer -> Item shape grid -> Item actions then set up a UseItemActionSetAttribute... but that's as far as my understanding of the documentation goes.
I tried adding a script as attribute, then setting the name of that attribute the same as the attribute name I put in the use item action.. But that didn't help.
The "use" button is generally greyed out.
I am also occasionally getting this error, however I have no clue where I am supposed to be missing a reference. I suspect that it has to do with the reason why I can't get the item to work, but I couldnt find anything missing in either the UI department on the player.
Note, I am using Opsive's first person controller and dialogue system integrations in case that changes things.
What I am trying to do is creating a potion that executes a specific script once upon use.
For example: Use potion -> add effect to camera.
However, I have absolutely no clue how to set this up. I've been messing around for hours with things in the UI Designer.
One of these is going to UI designer -> Item shape grid -> Item actions then set up a UseItemActionSetAttribute... but that's as far as my understanding of the documentation goes.
I tried adding a script as attribute, then setting the name of that attribute the same as the attribute name I put in the use item action.. But that didn't help.
The "use" button is generally greyed out.
I am also occasionally getting this error, however I have no clue where I am supposed to be missing a reference. I suspect that it has to do with the reason why I can't get the item to work, but I couldnt find anything missing in either the UI department on the player.
Note, I am using Opsive's first person controller and dialogue system integrations in case that changes things.
Code:
NullReferenceException: Object reference not set to an instance of an object
Opsive.UltimateInventorySystem.Core.InventoryCollections.Inventory.GetItemCollection (Opsive.UltimateInventorySystem.Core.InventoryCollections.ItemCollectionID collectionID) (at Assets/Opsive/UltimateInventorySystem/Scripts/Core/InventoryCollections/Inventory.cs:402)
Opsive.UltimateInventorySystem.UI.Panels.Hotbar.ItemSlotCollectionView.OnInventoryChanged (Opsive.UltimateInventorySystem.Core.InventoryCollections.Inventory previousInventory, Opsive.UltimateInventorySystem.Core.InventoryCollections.Inventory newInventory) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Panels/Hotbar/ItemSlotCollectionView.cs:141)
Opsive.UltimateInventorySystem.UI.Item.ItemViewSlotsContainerBase.SetInventory (Opsive.UltimateInventorySystem.Core.InventoryCollections.Inventory inventory, System.Boolean handleChange) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlotsContainerBase.cs:304)
Opsive.UltimateInventorySystem.UI.Item.ItemViewSlotsContainerBase.SetInventory (Opsive.UltimateInventorySystem.Core.InventoryCollections.Inventory inventory) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlotsContainerBase.cs:287)
Opsive.UltimateInventorySystem.UI.Item.ItemViewSlotsContainerBase.Initialize (System.Boolean force) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlotsContainerBase.cs:270)
Opsive.UltimateInventorySystem.UI.Item.ItemViewSlotsContainer.Initialize (System.Boolean force) (at Assets/Opsive/UltimateInventorySystem/Scripts/UI/Item/ItemViewSlotsContainer.cs:43)
Opsive.UltimateInventorySystem.Editor.Managers.UIDesigner.EquipmentDesignerEditorOptions.Refresh () (at Assets/Opsive/UltimateInventorySystem/Editor/Managers/UIDesigner/EquipmentDesigner.cs:386)
Opsive.UltimateInventorySystem.Editor.Managers.UIDesigner.EquipmentDesignerEditor.NewValidTargetAssigned () (at Assets/Opsive/UltimateInventorySystem/Editor/Managers/UIDesigner/EquipmentDesigner.cs:221)
Opsive.UltimateInventorySystem.Editor.Managers.UIDesigner.UIDesignerEditor`1[T].TargetObjectChanged () (at Assets/Opsive/UltimateInventorySystem/Editor/Managers/UIDesigner/UIDesignerManager.cs:656)
Opsive.UltimateInventorySystem.Editor.Managers.UIDesigner.UIDesignerEditor`1[T].Refresh () (at Assets/Opsive/UltimateInventorySystem/Editor/Managers/UIDesigner/UIDesignerManager.cs:613)
Opsive.UltimateInventorySystem.Editor.Managers.UIDesigner.UIDesignerCreateEditTabContent`3[To,Tc,Te].Refresh () (at Assets/Opsive/UltimateInventorySystem/Editor/Managers/UIDesigner/UIDesignerManager.cs:469)
Opsive.UltimateInventorySystem.Editor.Managers.UIDesigner.UIDesignerManager.Refresh () (at Assets/Opsive/UltimateInventorySystem/Editor/Managers/UIDesigner/UIDesignerManager.cs:184)
Opsive.UltimateInventorySystem.Editor.Managers.UIDesigner.UIDesignerManager.OnFocus () (at Assets/Opsive/UltimateInventorySystem/Editor/Managers/UIDesigner/UIDesignerManager.cs:159)
Opsive.UltimateInventorySystem.Editor.Managers.MainManagerWindow.OnFocus () (at Assets/Opsive/UltimateInventorySystem/Editor/Managers/MainManagerWindow.cs:658)
UnityEditor.HostView.RegisterSelectedPane (System.Boolean sendEvents) (at <8f44d91b549e47c9883e180579f26ef6>:0)
UnityEditor.HostView.SetActualViewInternal (UnityEditor.EditorWindow value, System.Boolean sendEvents) (at <8f44d91b549e47c9883e180579f26ef6>:0)
UnityEditor.DockArea.SetSelectedPrivate (System.Int32 value, System.Boolean sendEvents) (at <8f44d91b549e47c9883e180579f26ef6>:0)
UnityEditor.DockArea.set_selected (System.Int32 value) (at <8f44d91b549e47c9883e180579f26ef6>:0)
UnityEditor.DockArea.DragTab (UnityEngine.Rect tabAreaRect, System.Single scrollOffset, UnityEngine.GUIStyle tabStyle, UnityEngine.GUIStyle firstTabStyle) (at <8f44d91b549e47c9883e180579f26ef6>:0)
UnityEditor.DockArea.DrawTabs (UnityEngine.Rect tabAreaRect) (at <8f44d91b549e47c9883e180579f26ef6>:0)
UnityEditor.DockArea.OldOnGUI () (at <8f44d91b549e47c9883e180579f26ef6>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.EventDispatchUtilities.PropagateEvent (UnityEngine.UIElements.EventBase evt) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.MouseEventDispatchingStrategy.SendEventToRegularTarget (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.MouseEventDispatchingStrategy.SendEventToTarget (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.MouseEventDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel iPanel) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <6cf4b8f7a4344e9e9df60cc4c1690d8c>:0)