So I have a key that’s in the inventory of a player character, and the chest that it goes to. When the player attempts to unlock the chest, the chest will check the player’s inventory, and if they have the corresponding key, the key should be removed from the player’s inventory, and the chest should open and give them the treasure.
From what I can tell, the key does get removed from the index, but the index doesn’t get removed from the array. It just shows up as “None” when I look at the player’s inventory, and the indexes don’t shift up. I tried looking around at other questions to see if I could find the answer, but to no success. If anyone knows what might be happening here and how to fix it, it would be a big help. Thanks in advance!