Inventory system

Hello, I am a novice developer of unity games and really want to create an inventory system in my game as in “unturned”. I haven’t found even a close video where they tell how to make such an inventory. Could you tell me at least in general how to do this if it’s not difficult. I apologize for the concern, perhaps too “big” a question for the forum. But I think such an inventory system is the best and I don’t want to make it boring by cells in any way. Translated with the help of an interpreter, I apologize in advance for possible errors.

1 Like

Welcome! It is good that you have identified a base feature set, eg, “like unturned.”

Without discouraging you, let me offer you some insight into the things you need to consider.

These things (character customization, inventories, shop systems) are fairly tricky hairy beasts, definitely deep in advanced coding territory. They contain elements of:

  • a database of items that you can possess / equip
  • a database of the items you actually possess / equip
  • persistence of this information to storage between game runs
  • presentation of the inventory to the user (may have to scale and grow, overlay parts, clothing, etc)
  • interaction with items in the inventory or on the character
  • interaction with the world to get items in and out
  • dependence on asset definition (images, etc.) for presentation

Just the design choices of an inventory system can have a lot of complicating confounding issues, such as:

  • can you have multiple items? Is there a limit?
  • are those items shown individually or do they stack?
  • are coins / gems stacked but other stuff isn’t stacked?
  • do items have detailed data shown (durability, rarity, damage, etc.)?
  • can users combine items to make new items?
  • can users substantially modify items with other things like spells, gems, etc.?
  • does a worn-out item (shovel) become something else (like a stick) when the item wears out?
  • etc.

Your best bet is probably to write down exactly what you want feature-wise. It may be useful to get very familiar with an existing game so you have an actual example of each feature in action.

Once you have decided a baseline design, fully work through two or three different inventory tutorials on Youtube, perhaps even for the game example you have chosen above.

Or… do like I like to do: just jump in and make it up as you go. It is SOFT-ware after all… evolve it as you go! :slight_smile:

Breaking down a large problem such as inventory:

https://discussions.unity.com/t/826141/4

“Combining a bunch of stuff into one line always feels satisfying, but it’s always a PITA to debug.” - Star Manta on the Unity3D forums

2 Likes