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?
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:
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.
answered May 17 '14 at 04:14 PM
Steve Allison STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here