I am making a pause menu for a university project game. The exit to main menu button I have placed in the widget for some reason loads my main menu back for only 1 second, then goes back to the level but unable to move. I just want the button to reload the main menu again.
Transitioning from the paused menu to the main menu took me some time to figure out. It has its own system in a way because you have to have a set of Boolean values that check certain conditions before loading the correct thing. My setup maybe a little more complex then yours but when the player presses the main menu button from the pause menu several things happen. The show main menu Boolean is set true and the show introduction screens set to false since the player didn’t exit the game per-say, just going to the main menu so no need to show logos again.
Next these Boolean values are saved inside a Save Game Object on the hard drive so that when the level restarts it reloads that save game into the player HUD object and the first thing it does is checks the show main menu, show introductions Boolean to know which UMG to show. Technically when the player is viewing the main menu they are already loaded into the level but the main menu screen is on top of the player HUD (health, ammo, inventory, etc…). So when the player chooses to load a game the Boolean values are set again and the main menu is set hidden and the player saved location is loaded in to set them in the correct spot on the map when they saved the game.
I know this is probably way overboard for your setup but I hope it gave you an idea for how this works and what you might run into later on down the line. Someone else might give you a faster answer but I wanted to delve a little deeper on the concepts. Below is a screen cap of part of my level blueprint for the main persistent level, you can see how I save the values.
That happens if the target level name is invalid. Looks like you might be missing a forward slash and possibly the full path at the beginning of your string. Mine, for example, is “/Game/Maps/LoadMain”