How can I hide the menu after the level starts?

Hi. The play button in my menu is supposed to load the game, then hide itself. The level loads but the menu stays. Can you please tell me what I’m doing wrong? Thank you

Have you tried this node?

82931-setvisibility.png

On the BeginPlay after you create the widget but before adding it to the viewport promote it to a variable and then use that variable on the target pin of the remove from parent. Oh wait you are calling remove from parent in the widget that has been added to the viewport…remove that node and test it again it should self remove once the level loads.
If it is still displaying after the level load you will need to move the logic for its creation and addition to the viewport to a different BP so it can be stored as a variable to be removed the way I described above.

What is the pawn and controller for that menu level? Is it the same as the player pawn and controller for the rest of the game? IMO this would be the best way to go:

You should create a separate player controller for use in the menu level something like “MainMenuController_BP” and move widget setup and add to viewport to that player controller, that way the main game player controller isn’t the same one as the rest of the game…then set the main menu pawn to “none” in the menu level world settings…you should also setup a main menu game mode as well so you can setup even more for it with the HUD class set to “none” and you could prefill in the controller class etc and then just set the game mode for the menu level … then all these settings for the main menu are easily changed from a single location…anyway using a separate game mode and controller for the main menu should allow for more isolation and when you load another level the controller, pawn, game mode etc are all different and the widget wont carry over so you don’t have to use a remove from parent node.

I’ve removed the Remove from Parent node, same issue occurs. The logic for the creation of the menu is in the menu level’s blueprint. Where should I move it?

, I appreciate your help. I wasn’t able to get it to work just right with your solution. I think it’s just because the way my game is setup.

Here’s how I was able to get the menu working properly:

  1. Created a new level and named it Main_Menu

  2. In the Main_Menu Level Blueprint I “create” the Main Menu Widget Blueprint

  1. In the Main Menu widget blueprint, I do not use the Open Level function.

Now whenever the game needs to be reset or start from the beginning, I just call the Open Level function and target that particular level. Exampled here with this Retry Button:

1 Like