And when I later call the action to remove the item from inventory after it has been used in the scene, it will not remove it from the inventory, no error messages are printed either.NullReferenceException: Object reference not set to an instance of an objectAC.MenuInventoryBox.GetItemSlot (Int32 itemID) (at Assets/AdventureCreator/Scripts/Menu/Menu classes/MenuInventoryBox.cs:1081)AC.PlayerMenus.UpdateMenuPosition (AC.Menu menu, Vector2 invertedMouse) (at Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs:804)AC.PlayerMenus.UpdateMenu (AC.Menu menu, Boolean justPosition) (at Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs:875)AC.PlayerMenus.UpdateAllMenusAgain () (at Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs:1840)AC.PlayerMenus.UpdateAllMenus () (at Assets/AdventureCreator/Scripts/Controls/PlayerMenus.cs:1828)AC.StateHandler.Update () (at Assets/AdventureCreator/Scripts/Game engine/StateHandler.cs:332)
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Have you modified the UI in any way? The default Walking Dead interface has an inventory on the left-side of the screen? If your Inventory Menu's Source is set to Unity Ui Prefab, does it work if you change it to Adventure Creator?
What version of AC are you using? The script lines you've posted do not match up with the latest release - please back up your project and upgrade to v1.56c. It may be that this fixes the issue, but if not, the updated line numbers will allow us to debug the issue properly.
Replace line 1081:
if (invItem.id == itemID)
with:
if (invItem != null && invItem.id == itemID)
You should always back up your project when upgrading, of course, but AC's changelog file includes a set of "Upgrade notes" for each update. These cover any changes made that you need to be aware of - see Section 1.6 of the Manual. Of course, if anything does break, this is the place to get it taken care of.