Unity Inventory System - Easy Tutorial

preview_player
Показать описание
Inventory system is used in most of the games. If you need an inventory system in your game, this video is for you. In this video, I will teach you how to make an inventory system from scratch. Enjoy watching.

Hi from Solo Game Dev. I am a game developer. On this channel, I create easy to learn game development tutorials and develop games with Unity and the other game engines. These tutorials and games also include multiplayer games. In general, I create content related to game development, game design and games.

I also actively respond to comments and feedback so don't be afraid to let me know what you think, or recommend or request a specific video!

Follow and enjoy unique content!

You can follow me on Social Media and send your questions and requests from there!
#UnityInventorySystem
Рекомендации по теме
Комментарии
Автор

For beginners using this tutorial, take note of the enum itemtype section of this video. That will help you interact with your custom button for each item. E.G Use, Combine, Discard buttons. This is a great tutorial by the way

icresoftgames
Автор

If anyone is having an issue where the use item doesn't work on second time we open the inventory, it is because the inventory item controller array in item manager adds repeated item objects which was supposed to be cleaned via the clean content loop.

Solution: Move the clean content loop onto its separate method
Add this method to onclick event of close button of whole inventory.
Make sure you REMOVE clean content loop from ListItems method.
And you will be good to go.

orio
Автор

At 9:03 if Unity can't find the text component for itemName, try changing <Text> to <TMP_Text>. Thanks for the tutorial! :)

suzypayne
Автор

Wow, this is super cool man. Pretty flexible and easy to expand on. 💯

hazen
Автор

Hey, thank you for the tutorial! I was wondering if there was a way for items to be moved and organized in different slots. Do you also know how to drag the item out of the inventory to be placed down like a prefab?

alexsalontai
Автор

Thanks for the tutorial, this helped me so much but I have a question, how would I save the inventory between scenes and make it so that if the scene was reset the inventory would be the same as it was the first time that scene was loaded

TheSharkship
Автор

If anyone are getting errors from this line:
itemName.text = item.itemName;

It might be that you have used:
var itemName =

instead of:
var itemName =

The button might use the component TextMeshPro instead of the older Text variant. In any case, hope this might help.

Martin.Jorgensen
Автор

For those having issues with duplication in item controller array. Take the logic that cleans the list from list items and make it it’s own method. Then call cleanlist method when you close your inventory

chritsfootballs
Автор

Thank you ! You did a great job simplifying such a complex daw....Looking forward to be a great producer

muhammadfaturohmanristiant
Автор

hey, i've been using this system recently and I found a bug which I don't know how to fix. I made my objects grabbable when they you are on a trigger but if you grab two objects ore more at the same time they duplicate. It only happens when you grab two objects that are the same type. Please help, I don't know what to do. Thanks

Dani
Автор

Thx .Nice easy beginners guide. helped plenty!

markjeromedelacruz
Автор

This tutorial is great for people who have experience in programming, but not with unity. Well done!

kasekuchentv
Автор

Hello, I have tried to implement an inventory system to my game which is highly inspired by your code and I have noticed something. When dealing with more complex scenarios like opening multiple inventories from different objects, like chest panel from a chest, the item list gives some error while removing or sometimes in altering. The thing is I think your code is little casual friendly so you didn't go through all sorts of scenarios. For anyone who are getting error while removing an item from a list or processes like that, you have to write a safe code for changing the list. Thing I come up with is to make a copy of Items list and removing item in that copy. After you have done, assign the copy to your Items list. It somewhat like this:

public void Remove(Item item)
{
List<Item> newItems = Items;
newItems.Remove(item);
Items = newItems;
}
Hope you a good day...

baphometfromabove
Автор

TNice tutorials was really helpful for soone coming from Ableton Live and having used Fruity Loops waaaay back in the past

tendenciasmediodigital
Автор

Hello, what you are doing on 5:23, dragging the item to item Controller scripts doesnt work for me? Any idea why?

Marius-pppe
Автор

Thanks for the great turtorial, honestly this was on point and clear all the way, rarely do I see a tutorial as easy to follow as this.
just one question as I am trying to creat a counter for multiple items of the same type how would you advice me to start on?

pluacherry
Автор

The tutorial is great, but i'm having trouble trying to add two different kinds of objects with buttons that work differrently and none of the items in the Items list is being added into Inventory items list.

holywaddawadda
Автор

This was a great tutorial video! Thanks

pedrammoradi
Автор

In the listItems, where it is using the Find function, how should I be utilizing this? i'm a little confused on this, moreover what should be named ItemName and where does he have it

rileysorensen
Автор

Would it be better for me create the inventory slots via the editor (such as in this video) or Instantiate them with c#?

jocopowell
visit shbcf.ru