Today I did my best to create a functional inventory system that allowed the player to save an item held in their hands to an inventory system and summon objects back from said inventory at will. This presented a litany of issues off the bat: I had to figure out and add to code written by my team members, we had to decide on the list type we would use in the memory, how to dynamically test functionality while I develop the feature, bug fixing, and to top it all off I spilled water on myself during lunch.
Luckily, I was working on the feature with my team around so as questions came up, I could ask the guy that wrote the stuff. We had decided to use the linked lists Unity engine had already. I was able to test the inventory by repeatably picking up and use two box objects named Apple and banana. Unfortunately, the only solution I could act on was to wait for my wet pants to dry after lunch.
It's funny. I was feeling frustrated at the linked lists because it could have been really annoying manually move the inventory items up as the first object is summoned out. It had been so long since I worked in C# that I forgot the language did that sort of memory management for me. When explaining my problem, I tested it and the inventory system simply worked! Mostly...
There is still a large bug that the item, when brought out of the inventory, will initially appear at the location it was added to the inventory before lerping into the player's "hands". I tried many different possible solutions to this issue, but nothing was working and as I was testing these solutions less and less was changing regardless of what code I added. My next task is to iron out that bug as well as work with UI so that the player can easily track what is in their inventory during gameplay.
Did you like this post? Tell us
Leave a comment
Log in with your itch.io account to leave a comment.