- Home /
Hotbar for Diablo style inventory
So I followed this series of tutorials to the end:
https://www.youtube.com/watch?v=rJeXww9w2Eo
And it gave me everything I was looking for in regards to the inventory. Now I would like to move on to making a hotbar, but I'm not even sure where to begin.
Namely I was going to use the same method as the inventory to make a hotbar, and I'm not sure how the slots for the hotbar will function (i.e, the space is limited in the inventory space, but on the hotbar each object fits in a slot regardless of size)
If anyone can help me figure out a direction to go in it would be much appreciated! Thank you!
The hotbar just needs to hold references to items class instances on the inventory, so do exactly that; Declare an array of items and assign an item reference to an element in it when an item should be available from the hotbar. If you are going the UI way, give each button a simple $$anonymous$$ono script that holds a reference to the item, and call a method that uses that item when the button is clicked.
Thanks for the response! That seems reasonable, I think I can manage that, the only issue is that I'm not sure how dragging an item to the hotbar will work. Would I reference the list of items generated under the inventory script? Or would I reference the item that is being dragged?
I thought that's where the item's were stored in memory. I suppose not, seeing as how the list never populated properly for me...
Your answer
Follow this Question
Related Questions
Inventory code not working [JS] 0 Answers
Issues with Inventory script 0 Answers
Inventory armor wielding proplem,How to convert from derived to base 1 Answer
Inventory loop bolt 0 Answers
Count object list duplicates 1 Answer