Hello everyone.
Ive followed several tutorials but I havent figured out yet how to solve this.
I have my project, when I start it, it shows a MainMenu. I press Play and game starts.
Then inside the game, I press P for pause, and it brings MainMenu back. Here comes the trouble :
-If I hit Play, it returns to game. BUT if I press P again, it creates another MainMenu widget disabling me to exit the menu. How can I prevent this?
I know I can make a flipflop for every time I press P MainMenu appears and disappears but I want to force the user to hit the Resume button instead of pressing the keyboard.
Maybe a node for disabling the keyboard?
This is my blueprint, its made inside my character BP as you can see, its nothing fancy :
Very simple logic, just add a Boolean, and set it to true when you add the pause menu, and false when you remove it, only allow the player to pause if the variable is false.
Yes, right after the input, there should be branch, and the condition should be the Boolean variable, on the true execution of the branch it should go to the Set Game Paused.
Fine, I think it works this way. Even if I press P again inside the pause menu it doesnt bring over another widget. But a new problem has appeared, the second time I press P it doesnt bring MainMenu back anymore. Nothing happens. So the whole thing only works 1 time.
Sorry but I dont get it. Set it to false from the branch? Put another Set Pauseboolean node linked from True? Uncheck the Pauseboolean tick? It would help a lot to put a image with the process…
In the MainMenu if I press P, another MainMenu appears over the first one and I cant quit it anymore.
If I press Start, and then pause the game, it works. BUT after 2 times it stops working. Besides, I need to press P twice in order to make MainMenu to appear.
I think I desist. Its not possible to be this hard! Every change I make it gets worse…
Ok, send me a pic of your BP. You need to set Pauseboolean to false anytime you remove it with Remove from Parent, and set it to true anytime you spawn it. With that said, since you don’t want them to be able to use the keyboard to remove it, just use the same code for the False of the branch wherever you remove it.
This should work as sort of a flip flop that can be used in many places, anytime you either want to spawn or remove the menu, just use the whole blueprint that you have above. This should currently be working if you keep pressing the Pause input.
It doesn’t really work. It keeps duplicating the widget if I press the Pause input while I’m inside the MainMenu. Besides I need to press “P” twice the second time I want to go to the Pause Menu. Doesnt make any sense.
I think the only way would be disabling the keyboard inside.