I am currently doing lots of polishing, and extending of systems, before showing off my “Final” project… However, I ran into an issue that I can’t quite figure out…
I have created a new Door/Lock system. Basically a door can be unlocked, or locked, if the player has a key in their inventory, The door will unlock and open, if the player does not have a key in their inventory, then a console message appears, saying there is no key in the inventory… Thats all great and working fine…
However, I have set the keyItem.cs up as Stackable, and Consumable, as it inherits from ActionItem.cs…
I can drag the key Item onto the action bar, and click on it, and it uses the key correctly, though the only thing it does is print “Key Used”, because there is no door to unlock… The key is consumed… the quantity is updated, as expected.
However, when I open the door, the key used, the console prints the Key Used Message, The door unlocks, and the key is still in my inventory, and the quantity is not updated. Ive searched through the API, gone to previous lecture in the other course, and cannot figure out why the key is not being consumed when it is marked as Consumable…
Can anyone provide me are refresher on accessing the Quantity in the inventory? The system has access, its checking that the player has a key… but I need help remembering how to remove the item, because its only working when you click the item in the action bar… Thank you.