Main Menu Widget Not Closing

Alright so I found a solution.

  1. create a Dummy Level lets say “Menu_lvl”.
  2. go to project settings and search and set the Editor startup map and Game Startup map to “Menu_lvl” map/level.
  3. In the “Menu_lvl” level’s blueprint connect the following nodes like this
    Event BeginPlay → Create Widget (for class value = MainMenu) → Add to Viewport (connect the target too).
  4. then in your MainMenu widget blueprint select the correct logic of the level/map you want to open when the start button is clicked (prefer using Open Level by Object Reference as you might face some packing problems).
  5. save and compile all blueprints.
  6. done.

the problem mainly occurs because you set your level/map as default level to open when you play game, because of which the when you click start button it does not work as the level is already running and thus your main menu does not disappear from your screen.