Main Menu won't disappear

Disregard my previous comment. I fixed the collision issue. I will keep updating as I continue.

if you have a gmail, i would add you to google hangouts where we can answer some of your questions

Widgets that are added to the viewport can sometimes appear twice because the action or the trigger that creates them fired two or more times instead of just once. You will get one widget over the other and since they are in the same location they do not show as stacked widgets but as one. So basically when that happens and the Remove from Parent function gets called it always lags one widget behind, so you are stuck with one widget (usually the first that appeared) that will not go away.

The simplest and safest way to prevent this is to use a bool (in this case “isPauseMenuOpen” before creating the widget as shown in the image. This way you will never get a second widget to appear unless the first one is gone.

Just don’t forget to set the bool to FALSE wherever you call the Remove from Parent function. In this example I did it in the widget itself since it was there that I remove it from parent.

I never create widgets without it.

Hope that helps.

For me it helped to check the “Is Volatile” at the button.
Nothing helped untill I checked it.

88231-widget.jpg

Hello,

I’m having the same problem, the main menu won’t disappear when I press play.
First of all I’ve inserted a lot a Prints in the script and everything seems to work, when I press Play the level is loaded but the Button from MM won’t be removed.

A brief explanation, I’ve created a 2D project, start working on the Main Level, worked at the HUD a bit, the MAin Character movement, sprites and stuff. After this I’ve added a new widget for the MM, in the same project, and I have the same problem.

I’ve noticed that, when I load the game via Play button from editor, along side with the menu it loads also the level that I’ve created and I can move the player without even interacting the MM buttons. When I chose to click on the Play button in re-spawns my Main Char, but the MM buttons will still be there.

Do I need to create a MM widget inside a new porject so that the level won’t load in the background or is a setting that I might have triggered?

Thanks in advance

I found that this works the best in when removing the widget.

Worked for me, thanks buddy! :smiley:
(also tried all other solutions upper without any result)

Note: The ‘Remove All Widgets’ doesn’t exists in my case (or due to updates), so I used the "remove from Parent’.

  1. Create your Widget in a the Levelblueprint of a empty Level you dont use
  2. done

Sorry for the necropost but maybe this helps someone, I had same problem getting my menu that was set up exactly as OPs dissapearing. The problem was “Open Level” was targeted to open level that was already opened hence the BP did not fire properly, make 1 game level and menu level, set up BP to open game level… voila menu dissapears

Hey man! I may run into the same problem as you are. I solve this by deleting the open level node because I find my map is loaded earlier than my widget.Maybe it enters a never-end-loop.

1 Like