Removing every widget pressing 1 button

Hello everyone,
I know there are similar questions but I think I’m too dumb to figure out this myself with different examples :frowning:

I have 2 menus made with UMG. When I start playing I press the M button and menu appears, if I press M again, it disappears.
The menu has 2 tabs, one for general info and other for options. If I press the options tab, I cant disable the menu pressing M anymore.
This is my widget blueprint. If I press the button it goes to the selected menu and removes the actual menu and viceversa.

Now in my level blueprint I created a Flipflop node, so when I first press M it creates my menu.
But when I press M again I set it to remove from parent every widget (I created references for them)
Is there a way for removing every widget on screen? I want M to disable every single of them, even if I clicked 100 times between tabs.

Thanks in advance!

Hi
These are my 2 widget’s Event Graph:

In my level blueprint I only create my_menu widget blueprint because thats the one where you always start. Once you are inside it you can change to floorplan or return to my_menu.

Do I have to put another create_widget node?

Think I got it.

On the first on click, you are not destroying first widget. So it still there, then M add to port again. so will never go

Can you make a reference to both widgets at begin, and just use references.

Including the remove from parent in 1st pic.

Hi,
These are my 2 widgets blueprint my_menu and floorplan :

So when I press my first onclicked842 it removes the my_menu widget and shows floorplan. With onclicked830, its the same but in the other way.

That works just fine, but I wanted to press M in my level_blueprint and remove both of them. Right now pressing M only removes my_menu3 widget.
I tried adding a reference to floorplan widget to remove from parent, but it didnt work.

Where are you setting reference to either widget?

I can not see it anywhere.

You are not you showing any set variables?

This is my level blueprint

http://a.pomf.se/dshuxo.jpg

I create my_menu3 widget → promote to variable → get this variable for removing it after flipflop M.

Then for removing floorplan_widget I create a widget variable from floorplan.

But this doesnt work, it only removes my_menu3 widget. And if I press Button830 it doesnt removes any of the widgets.

I hope I’ve explained myself and sorry for the trouble.

Where are are you setting the Second Widget that you are referencing?

Sorry, keeps posting answers. Does not allow me to comment.

Hmm so do I need to create my second widget in the level blueprint?

http://a.pomf.se/pzqblj.jpg

TGhis may take a few mins, but try this.

Make a BP, called widgets.

In that BP, create both widgets and sey reference on begin play.

Then set something like this.

https://forums.unrealengine.com/attachment.php?attachmentid=35116&d=1429083483

***** edit ***** do in player character if you can not call the key stroke

Hi again, I tried your method but I found a simpler way and its working now! (Or at least it seems so)

All I had to do is to add after my FlipFlop’s B a Get All Widgets of Class node, and this way it removes everything on screen.

Thank you for your

As long as it is resolved.

Enjoy

Hi “Alice90”.
Any chance you could post your graph for the finished solution please?