Abayjit Sidhu

Game Developer | Programmer | Designer

Backpack Inventory System in Unity

Souce Code

Software Utilized

Unity, C#

Role

Programmer / Designer

Summary

I worked on this system recently as I wanted to refine my skills in Unity and try to make a system like this from scratch with as much flexibility as possible. To make the system dynamic and flexible, it utilizes scriptable objects where an item can be defined very easily. Also the size and the amount of grids of the backpack can also be changed dynamically.

When adding an item to backpacks inventory it will first check if the player even has a backpack and if so then it'll check if the backpack has space. To do this the backpack has inventory grids where the system can easily check if there is available space or not based on if an item is already occupying that space. Also it checks if the item can fit in the inventory based on it size, if not then it'll try adding the item to another grid if there is one available, otherwise it won't add the item to the inventory.

Project 1 Screenshot Project 1 Screenshot