How can I add multiple hitboxes with the same name?

See preview: i have created a function called: InventorySpaces. This will be drawn on a predetermined location which will create my inventory. Now i use integers to spawn items. e.g. if the int is 1 it will spawn texture 1 with hitbox 1. But here comes the problem. When i use the mouse over hitbox event it works fine with the first hitbox e.g. hitbox 1 (1) but when it draws a second hitbox with the same name hitbox 1 (2) it doesnt respond to the mouse hover over.

How can i add multiple hitboxes with the same name?

Hey Emptyless,

Hitboxes will need to have a unique name in order for them to respond to their own Events like Cursor Over. If you are using something like a ForEachLoop to generate inventory boxes/icons in your HUD, you can generate unique HitBox names every time for each item you need to draw by using a setup like this:

Since the Array Index will increment for each item, each HitBox will be named uniquely. If you need different functionality for each HitBox (or if you want to do some debugging with each one), you can plug in a Switch to your Event Receive Hit Box Begin Cursor Over:

6466-hitboxes2.png

Hope this helps! If this solution doesn’t fit what you need, reply back with more specific information about what you want to do and we’ll provide further guidance.

Cheers,

-Steve

Im sorry i wasnt able to reply sooner but thanks very much for this answer!

Though i stumble upon a problem when using the switch on Name. When i have for example 22 logs in my inventory i need to create 22 hitbox names in the switch on name. I would think that it should be easier to add interaction with just the one item i created.

What i want to create is an inventory that i can interact with. Like the old runescape inventory for example. I can right click to see my interactions with an answer.

I have 3 images describing the current situation. I use a tree and when i chop it down it spawn an event. this event triggers an “item number” eg 1 and this goes in my item function. This function checks for the next available slot and depending on the number of this item it spawns a texture. now what i want is to interact with these textures and have the same interaction for each texture clicked. So if i click my willow log in my second inventory space to act the same as my willow log in my 9th inventory space. So if i decide to burn the 9th that one dissapears and i can do the same with the 2nd.

But for weapons for example i want to be able to wear them and not show the burn option. This is for all gear etc. If i have to create a switch on name like described i could be busy for like a year to write 28 name switches per item for an inventory with 28 items

hope this helps but already thanks very much for help

https://forums.unrealengine.com/attachment.php?attachmentid=1796&d=1399288730

https://forums.unrealengine.com/attachment.php?attachmentid=1798&d=1399289399

https://forums.unrealengine.com/attachment.php?attachmentid=1799&d=1399289429

Hey Emptyless,

It sounds like if you have that many items you need to check against, you might want to store all of the HitBox Names you create in an array and when you trigger the Event Receive Hit Box Begin Cursor Over or any other Event for your inventory, have that run through a ForEachLoop on that HitBox namearray and compare the Box Name to each entry, then execute the rest of your code. Depending on what you need it to do, this would potentially make your inventory list more customizable in size and the code burden would be much less (not having to create multiple Switch On nodes with lots of possible entries).

-Steve