In my main menu the variable works fine and is set to false but when I click my button to go into the game the variable is still set to false even though in my main menu widget when that button is clicked I have that variable being printed being set to true.
The reason I have this variable is to check if the main menu is still open because I don’t want to open up the pause menu when i can see the main menu and only want to open the pause menu when i am in game.
Where I have the variable being set (I have to false by default):
This is on the main menu in the top corner the printed variable is displayed:
This is in game after i click new game the variable is being set to false still somehow:
This is the blueprint in my first person character where I check if escape is pressed it opens up the menu:
If anyone knows how to fix the problem i am having please help.
Thanks,
1 Like
I can’t quite tell from your description, but it sounds a bit like you might be setting your menu ( and variable ) up in a separate menu level, then using open level to start the game?
If your bool was in a widget level, it will disappear when you use open level.
Somewhere that is safe from the trashing that open level gives you is the game instance. You can control the menu from there.
Or: Is all this happening in the player?
It might to show and hide the widget rather than create it and destroy it. When the widget doesn’t exist, neither does the bool.
So I have the main menu being open on a begin play in the player blueprint. Below is a screenshot of everything that happens when new game is clicked witch is just dealing with letting the player move and control that camera so the main menu is still in the same level you play in I have also took a remove from parent node and replaced it with that set visibility node like you said the only place I ever use open level is in a scope in the player that used be detecting if when the player is dead you press a key and respawn but that is no longer connected to anything.