- Home /
Unity Time.timeScale is out of range. Any chance to set it to 360?
I've been trying to building up some kind of an agent based model with Unity3d, but I'm in the need to set Time.timeScale to 360 (even more in the future).
When I tried, its giving me the following error: "Time.timeScale is out of range. When running in the editor this value needs to be less than or equal to 100.0"
So, is this editor specific (as it mentioned in the error, because I couldn't find anything proper in the docs) so can I keep building the model like its working as scaled to 360 (after built to the platform)?
Additionally, is there a way to bypass this limit somehow?
Or should I try to multiply every calculation I make with Time.deltaTime with my custom multiplier?
Any kind of help, comment, suggestion is appreciated.
Answer by WeirdBeardDev · Jun 27, 2020 at 03:43 PM
I ran into this problem myself and the documentation is virtually nonexistent. I ended up doing a test and found that the limit only exists in the Editor. I created a WebGL build with Time.timeScale set for 1000, and hooked up a button to manually trigger it. Sure enough the console.log shows that it took 1.8 seconds to process 1,800 seconds of game time with timeScale set to 1000.
I worked around the Editor limit by adding the following code.
#if UNITY_EDITOR
Time.timeScale = 100f; // Editor limit
#else
Time.timeScale = 1000f;
#endif
Hopefully, this will help someone other searchers.
Your answer
Follow this Question
Related Questions
Is there a way to speed up the game more than 100 times? 1 Answer
2nd independent deltaTime and timeScale variables, or a way to mimic this? 1 Answer
Lowering Time.timeScale and lowering Time.fixedDeltaTime 1 Answer
Multiply deltaTime to arrive at point2 in 1.5 sec ? 1 Answer
Pause menu doesn't pause everything 0 Answers