Working on a survival horror game. This is actually my first time making an inventory for the player so I naturally ran into some problems.
I've made a Frankenstein's monster from a bunch of tutorials and examples I could find.
What I had in mind is to make a player collide with loot and destroy it, while putting the correct item in the inventory slot. When inventory gets full, the player stops destroying loot items on contact, so that they can pick it up later.
The code mostly works fine, up until it needs to destroy the last item before inventory gets full. I'm not sure what causing this...