I am making a dungeon game and I need a great inventory system that allows me to drop items and pick up items. Similar to the Minecraft hotbar, and I can drop an item and replace it with something else. Although I only have one item in the game currently and was wondering why it kept multiply in my inventory so much as you collect more of it. I haven’t added the feature to delete the item in the inventory when I drop it so don’t bother about that. I just need help on why it kept multiplying in the inventory. I checked the code multiple times and I couldn’t find anything wrong with it. Can someone pls help me find a solution to this. It may seem complicated, but play the game and pick up three potions and you’ll see what im saying.
Game link. Flowlab Game Creator - Dungeon Rpg