Is it possible to set up multiple hit boxes in a 2D environment?

Hi there,

I set up three onclick hitboxes for 3 buttons in a 2D environment. For some reason only the first one in the line works, the other two doesn’t. If I rewire them, I got the same result: whichever is first in line works, the other two is like they aren’t there. Is it possible to wire them in a way so all three will be clickable?

I appreciate any help :slight_smile:

Hi Airner,

Which version of the editor are you using and could you also post a screenshot of you blueprint setup as well.

Hi TJ,

thanks for your quick response. I use the latest 4.4.0 version of the editor.

As you can see on the screenshot, the event is now connected to the “Leftbuttonidle” hitbox, but when I hit Play, only the “HYPEbuttonidle” hitbox is clickable.

Hi Airner,

I believe what you are seeing is OnClick attempting to name the LeftButtonIdle hitbox to the name of the last box you clicked on. To better see what is going on, while playing hit the ~ key to bring up the Console Command prompt and type ‘showdebug hitbox’.

I would suggest just naming your hitboxes manually because when OnClick is called it gets the name of the hitbox you clicked automatically. Try the setup below to see this in action (minus the coordinates and size of course).

Hi TJ,

I tried the blueprint above, but unfortunately the problem still the same: only the HYPEbuttonidle works, the other 2 does not react to clicks :confused: any other idea what might be the problem?

Try creating a new HUD blueprint and testing it there, it is possible that your blueprint could have gotten corrupted. If it still doesn’t work, try testing it in a new project. This method should work just fine in 4.4.

I did that, created a new HUD blueprint, set it in my game as hud, made an exact copy of your blueprint. Didn’t work. Tried to make a new project with just this blueprint in it, didn’t work either. Any ideas?

Hi Airner,

I’m sorry its been a few days.

When you tested this in a new project with my blueprint, nothing could be clicked? Or were you getting your original results where only one box was clickable?

the question has been solved since then, anyone struggles with the same problem can find the solution here: