Pause / Un-Pause with same key not working

Try having a variable that changes between true and false when the player pauses/unpauses the game. For example, have a boolean variable that changes to true when the esc key is hit for the first time then will change to false when the player clicks the resume button AND/OR when the player hits esc the second time. Instead of having a flipflop, have a branch that checks the variable. If the player hits esc, have it check to see if it’s true or false. If its true, execute the code to unpause the game, then change it to false. If it’s false, execute the code to pause the game then change to true. Make sure that the variable changes to false when the resume button is clicked too.

Try that and let me know if you are still experiencing problems!