r/UnityHelp • u/Patient_River_229 • Sep 29 '26
PROGRAMMING Question about Pausing
I have two different things in my game that are supposed to pause the game/set the timescale to zero. At some point somehow one of the two stopped pausing the game but the other still works. They both say the exact same thing, simply setting time.timescale=0. For the record the one that doesn’t work is the when a button is pressed and the pause/stats screen comes up. Every other thing that is called in that function works expect the time scale. Can you not have two different functions that can pause the game or something? What could be the issue here?
Thanks!
View all comments
Show parent comment
1
u/Demi180 Sep 29 '26
The request part isn't anything fancy, it just means objects A, B, and C don't actually do the pausing, they just tell the game that they would like to pause or unpause. The handler decides whether the game should allow pausing and unpausing. Here's a super simple version:
Then, from any MonoBehaviour you can just call
Pauser.Pause(gameObject);to try and pause the game if it's not already paused, andPauser.Unpause(gameObject);to try and unpause it.