Download

Need Conceptual Explanation Of How To Show Inventory In HUD

To anyone who has made hotbars or inventories, how would I go about visually representing an array of actors I have on a HUD? I don’t need a tutorial, just a point in the right direction. I can do it myself I’m sure once you help. I’ve coded the actual inventory, but there is no visual representation yet and I can’t get my head around it.

Any help is appreciated – thanks!

What you can do is a add some buttons that show textures of each of the items in your array. Then, you can add events for each button (like on click or on hover) to interact with the items.

For example, you have up to 10 items in your array.

  1. You create 10 buttons in your inventory, one for each item.
  2. You assign, to each button, the corresponding texture (for example, your first button will be related to the item in index 0 in your array). If you have a potion in your index 0, show a potion texture in the first button in your inventory.
  3. So, now that you are showing in the screen the texture of the item, you can bind an event to clicking each button. Then, in the event you just fired with the click, you have to make a reference to the button index, get the item in your inventory array, and interact with it.

Let me know if you need more guidance and I’ll post some screenshots of a quick set up.

Thanks so much, man. That’s exactly what I needed. Will message you if I run into any issues. By the way, look forward to your implementation coming out soon!

Wait, I lied. One more thing: how do I get a texture to correspond to my item. Is there a way to create a “thumbnail” field in the asset browser to standardize this for many items?

Thanks again!

Hello,
you create a texture variable in your master item blueprint and set it in your child item blueprint.