Pausing the Game

I currently dont have access to unity to test this so I thought I’d ask about it here. Is it possible to pause a game using Time.Scale by setting it to zero? And is there a better way to pause the game?

i’m currently wondering if you are really the first one asking this question in this forum. i mean it seems to be a really general topic. but as lazy as you i dont want to use the search to find it out. maybe someone knows it and wants to answer this question?

It’s Time.timeScale, not Time.Scale and yes it will work as a Pause menu.

It will affect everything contained into FixedUpdate functions, physics, and all calculations involving Time.deltaTime.

OnGUI and Update will still work, meaning that you can easily go back from Pause to normal by creating the relevant buttons.

Note that if you need to calculate with deltaTime during pause, you’ll need to create your own custom deltaTime.

Source : Unity - Scripting API: Time.timeScale

Thanks Divine, and srry I forgot to type the time before Scale.

You can use Time.realtimeSinceStartup to track time while Time.timeScale is 0