Blueprint HUD buttons with hitboxes?

Hi guys :slight_smile:

How do I create a blueprint for buttons, so if I click on the hitbox of the button, it executes an Event Receive Hit Box Click and activates different parts of the blueprint for the different buttons? All 3 buttons should have different effects when clicked on.

Thanks for any ideas :slight_smile:

I was just trying to do this myself and I found it to be rather easy :slight_smile:

You simple set up your hitboxes with “Add Hit Box” calls, give them a unique name and then listen to the “Event Receive Hitbox Click”.
The Event will provide you with the name of the hitbox that had been clicked on and you can choose your actions depending on that name.

So, the key here is to supply all set up hitboxes with unique names and refer to them via that.

Works like a charm here.

I would like to add some information.

This is done inside the HUD Class or for you the HUD Blueprint. So you need to create a custom HUDBlueprint and change it inside the Project Settings.

Size X and Y of the “Event Receive draw HUD” are the users viewport size. For example 1920x1080. So you could use these numbers to calculate the position and size of the hitboxes to match each game screen resolution.

You can also show your Hitboxes ingame with the console command “showdebug hitbox”.