Time.timescale set to 0 whenever i start

I’ve got this odd issue, whenever i start my game, the timescale is set to 0, effectively pausing the game.

I have no idea why my game does this, i’ve read and reread all my scripts to find out where i’ve done this, but i cannot find it.

So, is it possible for me to have pressed some button that makes unity pause the game whenever i start my game?

Cheers

  • Kacer

Well, after a lengthy discussion we discovered you can set the Time.timescale permanently for the project using:

Edit → Project Settings → Time.

The hotkey pixie may have paid a visit. Let us know if you found a hotkey btw, be handy to know :).

Check Edit → Project Settings → Time pane

There may be some setting somewhere in your script. It can be on the update function or OnGUI (). So reread all the code again to find the issue. Also, you can set the timescale = 1 at the beginning.

i.e

function Awake ()
{

   Time.timeScale = 1;



}

Again, try to reread your code to find error.

Make sure you don’t have the “Error Pause” option selected in the console.

Thank god for this post, I had the same thing just happen to me, spent 20 minutes browsing all of the recent changes I made to my code, gave up in frustration and then decided to check answers to see if it was an issue others have had. Never once did I open up the Project > Time window to change that value to 0, not sure why or how it happened but thanks for this post.

Maybe you do as timsk suggested

<-replay by timsk->

another thing you can do is:

Create a new script, call it timetest.

in this script add the following:

function Awake()
{
print(“time is:”+timeScale);
}

function Start()
{
print(“time is:”+timeScale);
}

Then change your execution order so that timetest is the first in the list. This way, if you see timeScale as 1. We know one of your scripts is changing it.
<-replay by timsk->

buy create a new empty scene delete all the gameobjects, and create a empty gameobject just attach the script alone.
Note : before press the play set the project timescale to 1, form the projectSetting → Time → timescale.
Left me konw what if is works, and timescale doesn’t change to 0!

Hope this can help you…

The idea is like that, normally timeScale defaults to 1 in “Edit->Project Settings->Time”, but if in your code at some moment you change timeScale to 0(e.g. when you emulate game pause) then that value will change to 0 in project settings, and if you have the bad inspiration to “Save Project” in Unity Editor exactly while your game is paused and even more to close Unity Editor immediately after, then next time you’ll open Unity Editor you’ll have that value to 0 in project settings without even noticing.