Hello,
I got a little problem here. I know why the code doesnt work, but i dont know how to get around this problem. I want to use the same button to open and to close my pause menu (escape). The problem is that when i set the first var (MenuOpen = true) my second if statement is true and it closes the menu again. How can i fix that.
The debug.logs where just there to test stuff out.
Note that you should never use the OnGUI() method to do logic since it is a drawing method that can be called more frequently then the Update() method (Source).