Let me first start off by saying I love UE4 and how far it has come. So today I starting toying around with UMG. I just wanted to create a menu that shows 2 buttons labeled “Settings” and “Exit”. Settings at this point doesn’t do anything but Exit does. I followed the instructions from the Twitch preview video to learn how to execute console commands to create the Exit button. Now here is the problem that I’m having. When I launch the game and press escape the menu shows and everything works, but I want to be able to press escape again and close the menu and return to the game. Here is my blueprint set up inside the character blueprint.
Awesome! glad to see people are doing tings with UMG already.
Just some quick debugging - If you hook up a separate input action (just search for Input A or whatever letter you want, add that to the BP) to the “Remove From ViewPort” does it disappear? if so, the problem is in the logic around the flip-flop. What happens if you try to command it to remove with another action?
So I took out the flip-flop and just directly connect to render to viewport. Then I assigned the Z key to remove widget from viewport but still doesn’t clear the menu.
I would guess the character BP never gets the input, cause you set the widget to modal. Try set the widget modal flag to false. Or, remove the widget from within the exit-function.
Had trouble with that as well. The only solution I could come up with was to include a “Resume” button and just used the “Remove from Viewport” function inside the widget blueprint and of course adjusted the player blueprint to follow with widget. If anyone comes up with a solution please let me know.
Well, I just created a widget with a button inside and bound an onClick event to the button. Within the GetOnClickedEvent function I simply added a RemoveFromViewport node.
That worked fine. A click on the button removes the widget.
Maybe only because I can’t get the widget to show up modal at all :-/
I wanted to do kind of the same but just making the menu appearing/disappearing by pressing TAB
So I just followed the twitch tutorial and then I replaced the “event begin play” by “Tab pressed” but it doesn’t work !