how to disable Pause menu inside the main menu?

Hello guys! I know it very simple but I really stuck here, I have an issue in the main menu, when I click the paused key inside the main menu level the paused menu still appear, I just want that to appear inside the game level.
Can you suggest a solution for that please :\ ??

okay, guys here is my pause key blueprint, I just want the pause HUd to appear only on the game level, not main menu, so I want to disable this key (paused) on the main menu?

any brilliant guy around here can solve this issue :slight_smile: ??

any answer :slight_smile: ??

There are two ways I would use:

  1. Use a state. Declare states for main menu and in-game and then just check the state variable when pressing pause key to show or not show the menu
  2. Use a different Pawn when Player is in Main Menu, so this logic does not work. You can then implement other features such as special movement inside main menu (we had moving around a planet by swiping) and switch to your HorrorCharacter when starting (e.g. by loading another map which has that HorrorCharacter set by the default gamemode)

thanks for the reply, how can use the state option what command should I add, please see my blueprint above

Well first you create an Enumeration in the editor. The Enumeration contains all states that make sense in your game like MainMenu, InGame etc.
Then put a variable of the type of this Enum somewhere it makes sense, I recommend the GameMode if building a Singleplayer game (keep in mind that there already exists a state with PostLogin, Playing etc., maybe you could use that).
When you start you set that state to MainMenu, when the player starts a game you set it to InGame etc.
Now when it is time to show the pause menu you simply check for the current state and show the Pause Menu depending on that.

thanks alot birdfree :slight_smile: I will try to create this Enumeration tonight

sound very complicated :frowning: any new suggestions??

Just create a boolean variable to check if you can use pause menu at this moment : “bPauseAvailable?” default True.
Add branch node to your PauseMenu event and check this variable. (true → create widget / false → nothing)
Set your boolean variable to False in your MainMenu event.
Set your boolean variable to True when you remove your MainMenu.

I created the first part, but how can I do this:
Set your boolean variable to False in your MainMenu event. Set your boolean variable to True when you remove your MainMenu.

could you show me how :smiley: ?

Like I previously said :

You can also make the bool value directly inside your widget, like you want :wink:

That is not a problem, it’s the same logic, just cast your bool variable between your two BP.
Look and learn how to communicate between blueprints.

I appreciate your suggestion :), but the thing is my main menu events on another level not inside player BP :\
see attached image

I tried to cast it but the hud disappeared, leed me please I think I’m up to something XD

Im stuck here :\

It works! :smiley: I appreciate it Martoof!
Cheers,

Your cast failed because you tried to cast a controller to a character.
Use a get player character instead :wink: and it seems to be good !

You are welcome, don’t hesitate to train with BP communication !!