Viewport does not go away when i click start button on my game

I am very new at this and was following a tutorial and they said to add in “Remove from Viewport”. Now ive tried to enter this in every way i can think of and that option does not show up. So my question is what do i need to do to remove the viewport when i hit my start button so it is removed from the game screen?

I think what you want to say is that you want to remove a widget from a viewport.

Try removing your OpenLevel link and make the onClicked go straight to the Remove From Parent. Does this remove your widget?

If it did, then flip your “Remove from Parent” node with your “OpenLevel” node and add a Delay of 0.2 after “Remove from Parent”.

Hope it helps :slight_smile:

Thanks. Removing the open level made it work. I assume because the map i have open is the level im trying to open its causing some sort of problem. Thanks again.

I created the Main menu in a diffrent level and when i open the new level the viewport still doesn’t go away. So im back at square one.

I Just did the last thing you said up there. So now the menu goes away for a second and when the map loads it comes back.

A good way to deal with menu widgets is to create variables to hold them in the GameInstance blueprint (GameInstance is always available to you regardless what map you’re in, it is always local). Since GameInstance persists, you can add/remove widgets that have been created even if you change levels.

So, try to keep a reference to your created widgets in variables and use those variables to add/remove from viewport.

It’s been a long time since your post but I thought I’d reply as I’ve solved this issue. Create a new level to serve as a main menu. Your game loads into it, creates the main menu (in level blueprints), then the main menu blueprint opens the first level and destroys itself (redundant).

So Main menu level has the level blueprint, All your other levels do not.

It seems that the issue was that you would load the first level into the main menu, then the main menu would load the level again, which would create the main menu again. Hope that helps anyone else who encounters this issue.