ok so im trying to pause game when scene starts. and was told Time.timeScale = 0; would pause it. but it don’t. if i do Time.timeScale = 0.0000001; then it will pause everything.
why is this happening to me?
2 Answers
2Time.timeScale affects eveything releated with timeScale.
In your situation you can create a coroutine and return 1 yeild before setting timescale to 0.
Something like that.
(I have written it with notepad so there might be syntax errors.But the logic should be the same.)
Hope this helps. ![]()
IEnumarator WaitAndPause()
{
yield return null;
Time.timeScale = 0;
}
void Start()
{
StartCorotuine("WaitAndPause");
}
To pause all physics and all movement in your game, you have to use Time.deltaTime in your scripts. It would be equal proportional to your framerate and your timescale Unity - Scripting API: Time.deltaTime