Unity INVENTORY: A Definitive Tutorial

preview_player
Показать описание

This tutorial guide will show you how to create a full inventory system with draggable items, bottom toolbar, full inventory UI and stackable items. Please use video chapters to travel between video sections and learn more effectively.

--------------------------------------------------------------------------------
👨‍💻 SOCIALS:

--------------------------------------------------------------------------------
🎓 YOU WILL LEARN:
- How to create Unity inventory system
- How to integrate inventory with the building system
- Unity item stacks
- Inventory toolbar
- Inventory like in Minecraft made with Unity

--------------------------------------------------------------------------------
⚙️ VIDEO CHAPTERS:
0:00 - Intro
0:56 - Building the UI
3:53 - Showing/hiding main inventory
5:18 - Inventory drag and drop
7:00 - Items scriptable objects
9:28 - Initialise inventory items based on scriptable objects
11:02 - Finding free slot in the inventory
14:15 - Spawning new item
17:27 - Checking if the inventory if full
19:01 - Stacking items
23:06 - Showing selected slot
26:06 - Changing selected slot
27:13 - Using items
30:50 - Integrating with Tamara game
Рекомендации по теме
Комментарии
Автор

This is what I call a nice and thorough tutorial! Well done and thanks a lot for collaborating with me!

TamaraMakesGames
Автор

For those that have issues moving the item when the count is higher than 1.

In the InventoryItem class, OnBeginDrag turn off the raycastTarget for the Count Text
ex. CountText.raycastTarget = false or turn it off in the Prefab

Also turn it back on in the OnEndDrag function
ex. CountText.raycastTarget = true

rebornl
Автор

Honestly incredible, I had not found a tutorial so simple, effective and that goes directly to the point, full of examples, with a minimalist edition and perfect for the understanding of anyone who sees this video. simply incredible, my congratulations.

tbardo
Автор

this is taking me hours to skim through this back and forth over and over just to get it right

CoreyMcintyre-bk
Автор

Thank you so much for this! I definitely had NOT been crying myself to sleep struggling to code this the past few days

ghostoflarissa
Автор

Hello, I love the tutorial, very easy and useful, I would like to share this technique that I used to select the items with the scroll wheel of the mouse...

float scroll = Input.GetAxis("Mouse ScrollWheel");
if (scroll != 0) // Seleccion con el scroll.
{
int newValue = selectedSlot + (int)(scroll / Mathf.Abs(scroll));
if (newValue < 0)
{
newValue = inventorySlots.Length - 1;
}
else if (newValue >= inventorySlots.Length)
{
newValue = 0;
}

}

One other thing, if you are using TMPro to display the number of items, you need to disable the Raycast Target option which is active by default in the component, otherwise the stackable items cannot be dragged to another slot... hope I helped.

marcodeavila
Автор

This was an excellent tutorial! A great starting point for an inventory system. There's definitely a couple other things I'd like to add to this system but I really appreciated just how thorough and succinct it was for a relatively more complex system. Thank you for making this!

StealthyShiroeanGames
Автор

I was originally a little skeptical that this system wouldn't be very flexible, but I'm super happy with the end result. Thanks for the tutorial!

realbyte
Автор

Here's a quick tip I learned that saves some time. Instead of locking the inspector you can hit the three dots in the inspector for which area you want to keep open and select "Properties". This opens up a floating window with that area for which you can freely drag and drop :)
Saves you the time of having to Unlock and you can also have multiple floating windows open.

DemersCreations
Автор

Man made it easier than brackeys inventory tutorial... hands down to this dude much easier to follow. and less complicated

grifergaming
Автор

This tutorial taught us a lot of new things and helped us establish the groundwork for our project, there were some frustrating moments where something didnt work but usually reviewing the code and/or the video held the answer to the problem, thank you!

jadivods
Автор

This 35 minute video saved me hours of troubleshooting and research. Killed it!

Seputra
Автор

Best tutorial ever made on the subject. Finally a wise and proper utilisation of the ScriptableObjects concept. Bravo! 👏

Corummo
Автор

Thank you for coming back doing new tutorials ! :D

Jimaniki
Автор

A very good tutorial! Can you also make one on a load-save system? Including tile maps, inventory and maybe player settings? Thanks.

emilix_
Автор

Your tutorials are by far the best i've seen! Accurate, intuitive and extremely helpful! :)

macaronicrocs
Автор

This is the best tutorial I've seen. Easy to follow and clean explanation, very helpful.

acidxcross
Автор

This tutorial helped me so much for my end project for coding in school! Thank you so much!

Robin_
Автор

This channel is awesome 👍 so glad I found it, keep doing tutorials, cant wait for a nice shader tutorial

bonquaviusdingle
Автор

If your dragging item is not on the screen, Change canvas type to overlay (not camera)

fvx