Part 1: UI Creation and Game Pause -- Let's Make An Inventory System in Unity!

  Рет қаралды 11,729

Night Run Studio

Night Run Studio

Күн бұрын

In this video we’ll create a UI for our inventory that is highly flexible for different sizes and scales nicely for different inventory types. We'll set things up so you can call up your menus with a button press and pause the game while browsing your items.
This series is designed to be quite powerful, scalable for large games, and flexible enough to work with other menus like an equipment system, or skill tree menu. It is also designed to be user-friendly enough that even beginners can use and understand the code. In fact, this is partly designed as a resource for my high school students!
If you’re also interested in an equipment or skill tree system series, be sure to like and leave a comment to let me know.
Much of this system was inspired by the awesome work done by Sunny Valley Studio. I wanted to create something similar, but use code that my high school students would be able to understand and adapt. So.. we have what I hope will be a powerful, but easy to use system.
📖 CHAPTERS 📖
0:00 - Introduction
0:32 - Adding and Organizing UI Panels
2:07 - Setting Up the Layout Groups
6:09 - Setting Up the Input Manager
7:05 - Writing the Inventory Manager Script
8:28 - Testing the Script So Far
8:55 - Adding the Pause Feature
🛑 VIDEOS REFERENCED 🛑
🎦 Sunny Valley Inventory System Using Scriptable Objects
Elements of this system were inspired by the amazing work done in this series. If you want something even more complex, be sure to check this one out!
/ sunnyvalleystudio
🛑 MUSIC 🛑
🔊 Casanova by Tobu
From the Album: Sugar
/ tobuofficial
is licensed under a Creative Commons License. creativecommons.org/licenses/...

Пікірлер: 48
@justinbale6074
@justinbale6074 Жыл бұрын
Love the tutorials! Your guides are easy to follow and very informative. I'll be keeping my eye out for more videos. Keep up the excellent work, and thank you!
@NightRunStudio
@NightRunStudio Жыл бұрын
Thanks for sharing that! I love hearing that the vids are working for people.
@stephenq24
@stephenq24 Жыл бұрын
So far, so good. Your videos are great. Give the channel time and keep adding quality content. Trust me, it will grow. There is a great demand for Unity tutorials.
@NightRunStudio
@NightRunStudio Жыл бұрын
Thanks for that! As much as I'd love to reach a larger audience, it's still super encouraging to know the vids are helping people. Thanks for sharing.
@cheftechnique
@cheftechnique 2 ай бұрын
Thank You this actually made sense and was so easy to set up because you took the time to explain clearly and simply without too much extra info. You saved me!
@NightRunStudio
@NightRunStudio 2 ай бұрын
So glad to hear it! Thanks for taking the time to share this.
@magstargaming2193
@magstargaming2193 Жыл бұрын
Love this waiting for more parts. Finally a simple inventory system that i can add in my platformer game
@NightRunStudio
@NightRunStudio Жыл бұрын
Thanks a bunch! I'll try to keep rolling out the videos as quickly as possible.
@trollgasm
@trollgasm 10 ай бұрын
Already excited to get through this set of tutorials. Making a Metroidvania called Wheel King for a game jam! All very informative.
@NightRunStudio
@NightRunStudio 10 ай бұрын
Sounds like an ambitious project for a jam! Best of luck with it.
@racrity
@racrity 4 ай бұрын
Thank you so much for this! Clear and refreshing as college sumer vodka nights.
@NightRunStudio
@NightRunStudio 4 ай бұрын
That's the greatest simile I've ever had applied to me :)
@IzzWizard
@IzzWizard 2 ай бұрын
About to start this list of tuts. Thank you for making them.
@NightRunStudio
@NightRunStudio 2 ай бұрын
Hope you find them helpful!
@IzzWizard
@IzzWizard 2 ай бұрын
@@NightRunStudio I know I will. Already am
@user-gb8iu8ws3e
@user-gb8iu8ws3e 9 ай бұрын
u are the best 💜
@NightRunStudio
@NightRunStudio 9 ай бұрын
Thanks! Glad you're enjoying it :)
@coreygrace8937
@coreygrace8937 5 ай бұрын
this is lit!! lol
@IIDMovieWerx
@IIDMovieWerx Жыл бұрын
I like your style and this tutorial seems easy to follow however i am getting a error can you help ?? this is the error " InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings. InventoryManager.Update () (at Assets/InventoryManager.cs:19) I think its using a input system but I am having trouble adapting your info to it? thanks Frank
@NightRunStudio
@NightRunStudio Жыл бұрын
Thanks for watching! I haven't come across this issue before, but I suspect (as you said) that it comes from the new input system. I did a quick search, and found this post stackoverflow.com/questions/65027247/unity-conflict-between-new-inputsystem-and-old-eventsystem which may be helpful for updating settings in order to get things working. Hopefully that clears up the issue for you.
@seaderwerks3046
@seaderwerks3046 11 ай бұрын
Interesting. Only first episode, copied your input settings, along with your set up and script and set everything up, yet after entering play mode and pressing E, nothing happens. I can turn on the inventorymenu from the hierarchy, but after pressing e again it just closes and nothing happens after that. cannot reopen it. Wonder why.
@seaderwerks3046
@seaderwerks3046 11 ай бұрын
Ahh, fixed it. Seems even after adding an "Inventory" to my input manager and making the positive T for it, nothing continued to happen, So. I added this line of code in replacement of this (Input.GetKeyDown(KeyCode.T) && menuActivated) (Input.GetKeyDown(KeyCode.T) && !menuActivated) This resolved my issue. So if you don't want to go playing with the input setting within unity due to different types of input controls, this might fix what is blocking you.
@NightRunStudio
@NightRunStudio 11 ай бұрын
Thanks for sharing another way to do this! I imagine some people will find that super helpful!
@seaderwerks3046
@seaderwerks3046 11 ай бұрын
@@NightRunStudio On Episode 3 now lets see if I can get this inventory system to work. :P
@copycoffee7
@copycoffee7 Жыл бұрын
Hi Night Run, I seem to be getting a bug where if I open my menu in the air, then I stay frozen in the air. When I try to move again my character flips but stays above the ground. Any reason this is happening??
@NightRunStudio
@NightRunStudio Жыл бұрын
It sounds to me like your game is not un-pausing when you leave the menu. I suspect that your player flip is being called from FixedUpdate(which runs independent of the timescale method we are using to pause the game). That's why you can still flip the character, but you can't move because the game is still paused. I would double check that you are unpausing the game when leaving the menu. If you want to fix the player flipping issue, you will have to manually turn off flipping when you pause (the easiest is probably just to disable your playerController at the same time that you call the pause, and then re-enable it when you un-pause. I hope that helps!
@copycoffee7
@copycoffee7 Жыл бұрын
@@NightRunStudio it worked, Thanks!
@NightRunStudio
@NightRunStudio Жыл бұрын
Awesome! So glad you figured it out.
@kucirulz
@kucirulz 5 ай бұрын
Any simple way to create the blank/"empty" sprite you use for the series?
@NightRunStudio
@NightRunStudio 5 ай бұрын
You could: Create a new Sprite by going to "Assets" > "Create" > 2D > "Sprite". Set the Texture Type to "Sprite (2D and UI)". In the Texture Import Settings, set the Texture Shape to "2D" and the Alpha Source to "None". Save the sprite asset.
@kucirulz
@kucirulz 5 ай бұрын
@@NightRunStudio When creating it, how do you stop at "Sprite" without choosing the last option where you need to pick a form?
@NightRunStudio
@NightRunStudio 5 ай бұрын
Sorry… you do have to pick one but then making it default to 0 alpha should do the trick.
@NightRunStudio
@NightRunStudio 5 ай бұрын
If you open up the advanced tab on the inspector,you should be able to set alpha source to none
@kucirulz
@kucirulz 5 ай бұрын
@@NightRunStudio Thank you for replies! I can't make it work but I will try again later. I set the Alpha Source to none but that does not make the random sprite I chose invisible.
@SaphireDO
@SaphireDO 10 ай бұрын
How do i make inventory with infinity slots and scrollbar?
@NightRunStudio
@NightRunStudio 10 ай бұрын
An infinite inventory would need a slightly different setup; however, with this system, you could set it up with as many slots as you want (thousands....). You would just want to add a scroll bar so that you can move around in your inventory. It would take a whole extra video to get into that, but if you want to check out scroll bars, Unity does a lesson them here: kzfaq.info/get/bejne/gNadhNh9ybLHpGg.html
@saide7674
@saide7674 4 ай бұрын
hi for some reason when i press the letter nothing happens.
@NightRunStudio
@NightRunStudio 4 ай бұрын
Do you have your buttons set up in the Input Manager?
@TweetyStickFigure
@TweetyStickFigure 2 ай бұрын
@@NightRunStudiohow do I set that up? I don’t have it.
@NightRunStudio
@NightRunStudio 2 ай бұрын
@@TweetyStickFigure We do it at 6:10 in the video.
@TweetyStickFigure
@TweetyStickFigure 2 ай бұрын
@@NightRunStudio sorry I thought there was some settings I had to alter. I re watched it though thank you. Very useful tutorial (:
@user-gu8qv9cv7w
@user-gu8qv9cv7w 2 ай бұрын
How do you express HP in numbers?
@NightRunStudio
@NightRunStudio 2 ай бұрын
I'm not totally sure what you mean... like do you just want your health to be displayed on screen: 13/15 sort of thing?
@user-gu8qv9cv7w
@user-gu8qv9cv7w 2 ай бұрын
@@NightRunStudio Yes, Which of your lectures should I refer to?
@NightRunStudio
@NightRunStudio 2 ай бұрын
@@user-gu8qv9cv7w If you want a numerical system, this one should get you started: kzfaq.info/get/bejne/maykdqaAu8vJZGQ.htmlsi=X_FxShaoCKLzPqD8
@user-gu8qv9cv7w
@user-gu8qv9cv7w 2 ай бұрын
@@NightRunStudio Thank you!
Part 2: Collectible Items -- Let's Make An Inventory System In Unity!
7:32
Why Stairs Suck in Games... and why they don't have to
11:24
Nick Maltbie
Рет қаралды 1,5 МЛН
КАК ДУМАЕТЕ КТО ВЫЙГРАЕТ😂
00:29
МЯТНАЯ ФАНТА
Рет қаралды 4,4 МЛН
Does size matter? BEACH EDITION
00:32
Mini Katana
Рет қаралды 18 МЛН
DO YOU HAVE FRIENDS LIKE THIS?
00:17
dednahype
Рет қаралды 103 МЛН
Русалка
01:00
История одного вокалиста
Рет қаралды 6 МЛН
Can AI Code a Horror Game? Watch ChatGPT Try
8:06
BadGameDev
Рет қаралды 1,1 МЛН
So you want to make a Game Engine!? (WATCH THIS before you start)
14:39
Giant Sloth Games
Рет қаралды 277 М.
I Wish I Had Known This Before I Started Unity Game Development...
11:11
How To Make UIs without frustration | Unity Beginner Tutorial
16:58
This is GameDev
Рет қаралды 29 М.
Creating An Inventory System in Unity
11:03
Game Dev Guide
Рет қаралды 176 М.
50 МЕГАЯЩИКТЕН НЕ ТҮСЕДІ ЕКЕН?!
18:41
Асхат Gaming
Рет қаралды 47 М.