How can I create a simple button for my HUD?

I’m trying to create a simple button/call event UI. I tried using the new UMG but I got a lot of bugs with my cursor. Is there any other way to do it? Also, How to fix the UMG. It locks my viewport and doesn’t allow me to use the mouse. I’m building an RTS and I need edge scrolling and have it all set up but the UMG just shuts everything off.

There doesn’t seem to be any tutorial on HUD canvas Blueprints. I just want a simple button/action UMG does that but it causes weird bugs to my cursor. I guess it’s because it’s still experimental. Any idea how to do it through blueprints?

Yes by standard HUD canvas and hitbox to detect the clicks, you can also use Slate from C++ or make actor based menu and detect clicks on actors (but this solution depends on how you operate the camera).

In HUD class you make draw calls on DrawHUD, you draw button and then you use Add Hitbox and place it same point as button. And then use Recive Hitbox Click to detect clicks on hitbox

I managed to create a simple button with UMG, but the problem now is that I can’t click on it. My mouse is locked on the screen. I don’t know how to enable touch events.

Oh sorry ^^’ Set Show Mouse Cursor from player controller should do the job i think, you can also checge it in player controller defaults

I would like to call different functions on my buttons in HUD. Made the hitboxes but just can’t figure out how to connect them to the Receive hit box Click event. any ideas?

You se the names to boxes right? event return box name that ben clicked and you use switch to reroute it to diffrent code

I fixed this problem by removing the modal mode. Modal takes your keyboard and mouse focus, so you don’t get keyboard click events inside mouse controller. I’m not sure how to fix it. You can easily reproduce this by using add to view port for a widget with modal checked.

Hi Valkon,

I am looking into this issue, but I have a few questions. Can you send me some screenshots of the UMG, its graph and another of how you are creating the Widget and adding it to the viewport? That would help me to see what is happening better. Have you bound the Button component’s Click Event? Any additional details may help.

Cheers,

I was thinking that may have been what you had encountered. This is a known issue and our developers are working on a solution for it as soon as possible.

Please let us know if you encounter any other unexpected behavior with UMG. Feedback for UMG is important to us.