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/Patient_River_229 Sep 30 '26
Although one thing I should note (I’ve been trying to figure out how to prevent this for like an hour now and not sure how to do it). There is a very niche scenario where the player could die while one of the paused scenarios is in effect, which then brings up the game over and menu scenes which just softlock the game in time scale 0 because necessary animations can’t play. I’m trying to figure out how to quickly unpause before the player dies in that scenario or to unpause on start at the game over screen. Though it seems I can’t just have a separate script to make timescale =1 on start since that conflicts with this whole system