Can't click on buttons on Menu

Hi, I’m new to Unreal Engine, and I can’t seem to get my main menu to work. I can open up the UMG widget from the default level, but the buttons just won’t allow me to click them. I hover my mouse over, use my arrow keys, but nothing works. I threw together another similar setup in another project, and it worked fine. I could technically redo my whole menu and try again, but I don’t want to have to throw away all that work. Plus, if I could learn what’s up, I can overcome this problem in the future. Attached are pictures of my default level blueprint:

and of my MainMenu blueprint:

Yes; my “Gallery” widget is called that exactly, and it’s just a simple UMG widget that I just set up to see if I could get the clicking to work for now. As for the Design tab, I’m as much of a beginner that I don’t know exactly what that is, so here’s the designer window:

As for its blueprint, there’s nothing on it. Also, I found that the buttons can be clicked when I play it in a new edit window, but not when I play it as a standalone game. Eventually I wanted to make it so that I could scroll through the options with the arrow keys and select when I hit enter, but that’s quite a few steps down the road, it seems. And as for your second paragraph, I don’t know what that means…sorry… Here’s the error message that shows when I click the gallery button, by the way:

This has been a whole lot of one step forward, two steps back sort of thing…

Hello Pumpkin Man,

Are you sure that your level is called “Gallery” exactly? Capitalization and spaces matter as well. Have you tried leaving the blueprint graph open on another part of your screen while playing to see if the OnClicked is getting called? If not, could you share a screenshot of your Design tab for this widget?

This likely isn’t related to the issue, but using Tick to determine if the buttons should be highlighted isn’t the most performant way to do this. Are you setting the keyboard focus yourself? If so, you could try making your own custom event that takes in a button reference and pass it the reference of the newly selected button and change the color by calling it whenever you set the keyboard focus.

Open Level needs the name of a .umap file, not a widget. You’ll need to give it the name of a Level that you wish to change to.

That makes a lot more sense, thanks. So how would I go about opening a different UMG file? The hardest part about these softwares is getting to know the lingo…

Thanks So much!

All widgets must be created with the same workflow you used to create your Main Menu widget. The easiest way to do this, as I’m assuming you also wish to remove the existing Widget, would be to keep the return value of “Create Main Menu Widget”, use that to call “Remove from Viewport” and then use the Create Widget node to add the new one, along with the Add to Viewport node. You’ll want to store this value as well so that you’ll be able to remove it once you go back to the Main Menu as well.

Ah, a quick revision. I meant “Remove from Parent”, not “Remove from Viewport”

1 Like

I hate to bother you again, but could you explain the whole button highlighting thing in greater detail? All I wanted to do was start out with the Continue button highlighted (and therefore visible) and upon the pressing of the down arrow unhighlight the Continue Button and highlight the New Game Button, thus mimicking a selection screen. If I throw in a Set Keyboard Focus node I can get it to click a button with the enter key, but it won’t hover over it at all.
Thanks for your continued help.

Could you show the blueprint graph where you’re doing your keyboard controls for the widget? Are you sure that using the arrow keys is actually changing the currently selected widget?

I’ve done a lot of experimenting these past few days, but a question that everyone seemed to like told me to do this:

And that that was all that I needed to scroll through my buttons via the arrow keys in a vertical box.

P.S., this is in the intial level blueprint.

This will be a little complicated so let me know if you have questions.

The easiest and cleanest way to do this would be to create a Widget that just has a Canvas Pannel and one Button to reuse as part of your Main Menu widget. Once this Widget is created, compiled, and saved, it should show up in your Palette window under User Created.

The reason we want to do this is because there is a delegate function, which means it gets called under certain condiitions, for “On Focus Received”. This can only be tracked on Widgets however and not on individual buttons. With this set up, each button will be its own Widget so it would be able to be tracked for each one.

You would want to override the On Focus Received and On Focus Lost functions inside of the one button widget and have it change its color in these two functions. You can override these functions by clicking the Override dropdown beside “Functions” in the My Blueprint panel of the Widget’s graph tab.

After setting this Widget up, you could replace the existing buttons in your Main Menu widget with instances of his Widget, so that when they get focus, they’ll change color and go back to the normal color when they lose focus.

All right. I’ve got the separate button widget replacing the buttons on my main menu. However,

  1. How do I get OnClicked events off of these?
  2. How do I navigate through them with the arrow keys? That is, what should I attach to my BeginPlay event besides just Creating the MainMenu widget and adding it to the Viewport?
  3. And, can I get an image to be displayed on my buttons (so that when the button widget has focus it shows the image, but when it doesn’t, it’s just completely dark/black)?
    Thanks so much for your help!

Revision to question 2): How do I navigate through them with the arrow keys without having to click on them first? And how do I get the selection to wrap around (e.g., pressing down on the bottom option would highlight the top)?

Owning Player needs a Get Player Controller node wired into it.