Picking up an item and adding it to the hotbar

Updated on July 14, 2017 in [A] GUI
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
2 on July 13, 2017

So I’m currently making a small game that’s very “catch them all”-pokemon like. I want to create a hotbar and whenever you “pick up” a creature it goes straight to the hotbar. However, I don’t want a regular inventory system where you can swap items back and forth between your hotbar, and have a limit of 6 items that you can have on your hotbar. I read something about raycasts somewhere but I have no idea what that is, or how to implement it.

Another thing I need to have is a sort of “drop” function, that after you press a certain number (IE: 1 for the first item in the hotbar, 2 for the second, etc.) and then right click, it spawns the item/creature a few feet infront of you, and “locks down” the item number (basicaly the creature’s info is all still there, but you can’t replace it because the actual info is still there despite it being out of your inventory. Then to pick it back up, you could just walk over to it and press CTRL + right click, or something like that) 

 

(I know I will probably have to make my own GUI, but I don’t know how to do that either, can anyone point me to a good starting point where I can learn to do that as well?)

 

(I did watch his inventory system video but it’s not really what I need)

  • Liked by
Reply
1 on July 14, 2017

Very rarely will you ever find EXACTLY what you need in game development. That’s why it’s beneficial to explore (in-depth) many different, but similar tutorials.
If I recall, the inventory system tutorials have a GUI that’s set up to accommodate what it sounds like you’re looking for, even if the inventory system itself isn’t what you have in mind with just a quick modification or two.
So then watch a different tutorial series or two and see how they do it for their games, then you can pick and choose the pieces you like and become inspired.
You can find tons of inventory/hotbar tutorials by googling. Here are a couple that jumped out to me just now:
http://www.adventurecreator.org/tutorials/creating-inventory-bar-unity-ui
https://forum.unity3d.com/threads/inventory-tutorials.197096/
https://unity3d.com/learn/tutorials/projects/adventure-game-tutorial/inventory

on July 14, 2017

I am still very new to Unity, so it might be a bit difficult for me to just choose and pick what I need, but I’ll give it a try! Thanks for the links, hopefully all goes well : ^)

Show more replies
  • Liked by
Reply
Cancel