Learn how to create an inventory slot for an inventroy system in this tutorial. It is basically a button with three modes: An action to perform on click, one on hover, a third on double click. This can be used for a lot of different use cases, but you will most likely primarily use it in an inventory system. This works with the new input system and on mouse input as well as controller input.
This tutorial covers:
Creating a new type of button especially suited for inventory systems
Handling three kinds of events: On left click, on double click and on hover (enter and exit)
Hope you'll enjoy it!
📖 Github
Find my scripts here: https://github.com/Maraakis/Christina...
📖 Chapters
00:00 Use case: an inventory system
00:55 Setup in the Unity inspector
01:39 Creating the inventory button
06:26 Finishing the setup in the Inspector
06:45 Turn the inventory slot into a prefab to add it to the right click menu
📁 Get the PDF Version of my tutorials
Would you rather read a book? I have a collection of eBooks on the Unity UGUI System here:
📘 Itch: https://christinacreatesgames.itch.io/
💬 Join the Discord
You are very welcome to join / discord !
🎮 Play My Games
🎲 https://christinacreatesgames.itch.io
🛍️ Recommended Assets
https://assetstore.unity.com/lists/hi... [affiliate]
📖 List of books all around Gamedev and Design I recommend: https://www.christinacreatesgames.com...
Otherwise, using my affiliate codes for these stores helps to support my channel:
🛒 Unity Asset Store: https://assetstore.unity.com/?aid=110... [affiliate]
🏪 Synty Store: https://syntystore.com/christinacreat... [affiliate]
🪸 Envato Elements: https://1.envato.market/ChristinaCrea... [affiliate]
🟦 Amazon: https://amzn.to/3G8NgFq [affiliate]
🌟 Actionable UI Feedback for Your Game
I offer UI consulting for gamedev projects! With 15+ years of design experience and a background of a teacher, I’m here to help:
👉 Learn more: https://www.vennegerts.com/en/gamedev...
☕ Support Me on Ko-fi
If you enjoy the content and want to support my work:
💛 Buy me a cocoa: https://ko-fi.com/christinacreatesgames
#unitytutorial #unity3d #gamedev #indiedev