[CLOSED] how can i get unity back to the normal timescale after running the game with it set to 0?

i ran into the this problem once before, and they only way i could fix it was scrap the project and re-install unity. which was the only way i got it to work, but i lost 5 months worth of work. and now i am facing the same problem again with a pause menu that did the same thing.

when i wanted to set the pause setting to 0 it worked, but when i tried to unPause it, nothing happened i went into other areas of my game and found that they were paused.

i did try setting the timescale back to 1 but it only worked half way and my character’s movements were very choppy and did not preform as intended to.

the script i used was this:

// Toggles the time scale between 1 and 0.7
	// whenever the user hits the Fire1 button.
	function Update () {
		if (Input.GetButtonDown ("Fire1")) {
			if (Time.timeScale == 1.0)
				Time.timeScale = 1.0;
			else
				Time.timeScale = 1.0;
			// Adjust fixed delta time according to timescale
			// The fixed delta time will now be 0.02 frames per real-time second
			Time.fixedDeltaTime = 1.0 
		}
	}

found on the unity Wiki.

and i also get these errors, which i do not know where they come from or the source they are.

if anyone has every faced this problem and found a way to fix it or at least something to resolve it, i would greatly appreciate it.

thank you -

Ownerfate

19112-tok7.png

How about this line? EditorApplication.isPaused = false; [http://docs.unity3d.com/Documentation/ScriptReference/EditorApplication-isPaused.html][1] [1]: http://docs.unity3d.com/Documentation/ScriptReference/EditorApplication-isPaused.html

sorry, nothing is happening, still doing the same stuff.

If you click on one of the errors does it give you more info at the bottom of the console window?

> i lost 5 months worth of work. Ever hear of this newfangled invention called "a backup"?

[http://answers.unity3d.com/questions/13544/many-isfinite-errors.html][1] [1]: http://answers.unity3d.com/questions/13544/many-isfinite-errors.html

1 Answer

1

wait, wait… i want to understand… you set timescale=0 somewhere in your code and it messed your editor? you scraped the project and re install because of this?! how is that happen?! why you can’t edit your code and remove the timescale line? is this editor script?

yeah, i know it's strange but it effected unity in a way i could not work in any other projects, and even if i did remove it, is set the state to 0 and did not work. and @meat500: i took a look deeper and found the problem, i had to remove the whole level and rebuild it.

i think you may have something there, let me test it and see what happens.

ok, 2 things, with time scale, i set it back to 1 which was the default time of unity, i think the game will run, but characters are very choppy in movement, and frame rate was destroyed. Example: 200 FPS turned into 2 FPS. then stayed up to a constant 15 - 20 FPS. i will try the ' OnApplicationPause ' function. tested - somehow it worked, i really don't know why, because i didn't use that function on any script i'v written so far. but thanks.