Pause Menu Doubling


Author: Devon Flynn

Posted on 6/20/2025

 

This week when we were implementing our new pause menu, we noticed a major issue with the resume button. The first time that the menu was opened in the level, pressing resume would work as intended. However, if you opened it again then pressed resume, it would call the bound function twice and set the isPaused bool in the TogglePauseMenu function twice. Which would effectively lock you in the pause menu until you exited with the escape key.

This bug was increasingly frustrating because the escape key function, would function perfectly even though it ran the same bound functions as the Resume button in the pause menu. After working through this issue with Ben, we found that the binding for the resume button had to be moved to the player script. This script also housed the escape key binding. I hadn’t realized that when a widget is re-added to a viewport, it re-instantiates the bindings, causing the TogglePauseMenu bindings to run twice.

After Ben moved the Resume button binding, it began functioning as intended. The player is now able to seamlessly pause and resume the game at will. This will make UI transitioning much easier for player experience.

Leave a comment

Log in with itch.io to leave a comment.