Main menu

I’ve created a main menu for a 2D game I’m making but a problem I’ve noticed is that the player can still move the character around if they click anywhere but the buttons. Is there a way to fix this?

I think set inputmodeUIonly will do the trick

I can’t get the self node and target to connect. Here’s what I have so far.

Target ->Get Player Controller
In Widget Focus-> Self

The character still moves if you click anywhere but the buttons.

Where do you create this widget? That’s probably where you want the set focus to be. Right now it only gets focus after you’ve pushed that button and removed it from the viewport

I created this widget within the 2D game blueprints. When you press play it appears on the main viewport.

Yeah, but somewhere you must have this node, right? Right after that node you could do the set input to UI.

Or, you could add this node into the widget and set input to UI afterwards

I have two widgets. One for the Health bars and one for the menu. Should they be together?

Does not matter, but for now I think the simplest is if you go back into the mainmenu widget you showed in your screenshot and add a construct event and after that event you do the set inputmodeuionly with a get playercontroller 0 as the target and self as the widget to focus you should solve it

Like this?

Yeah, does that work?

When I click play it gives me a message saying “infinite loop detected in blueprint: MainMenu1”

Then I have no idea I’m afraid, perhaps someone else can help?

Do you have ‘modal’ checked on the blueprint node. That usually works.

Where do I find that?