Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
17
Question by Kacer · Sep 29, 2011 at 09:14 AM · timescaletime.timescale

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

Comment
Add comment · Show 9
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image timsk · Sep 29, 2011 at 10:00 AM 0
Share

There's a pause button next to the play button in the editor, check that isn't depressed :P.

How do you know Time.timescale = 0?

avatar image Kacer · Sep 29, 2011 at 10:26 AM 0
Share

because if i write "time.timescale = 1" in "Awake" the game runs smoothly :)

the pausebutton is unchecked.

avatar image timsk · Sep 29, 2011 at 12:57 PM 0
Share

a better way to check would be:

 function Update()
 {
     print("time is :"+timeScale) 
 }


This will check if Update is being called, and if it is you will see a frame-by-frame update of the current timeScale.

Let me know what results you get.

Also, i know you have said you have checked, but it is most likely you are pausing the game somewhere, have you got a pause menu script or anything similar somewhere? An error in that could be causing this.

Does this happen if you create a new, empty project?

avatar image Kacer · Sep 29, 2011 at 01:15 PM 0
Share

it prints the timescale as "0", which just confirmed my suspicions.

It does not happen in any other projects i have, and i do not pause the game anywhere, i'll gladly share my scripts if you doubt me :P

There is only one place in my scripts where timescale gets set to 0, and that is commented out, for debugging. I've tried deleting that line as well, but it doesnt change anything.

I am deeply mystified by this.

here's the print info:

time is :0 UnityEngine.Debug:Log(Object) Character$$anonymous$$ovement:Update() (at /Assets/Scripts/CharacterScripts/Character$$anonymous$$ovement.cs:36)

avatar image timsk · Sep 29, 2011 at 01:26 PM 0
Share

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.

Show more comments

7 Replies

· Add your reply
  • Sort: 
avatar image
43
Best Answer

Answer by timsk · Sep 29, 2011 at 01:52 PM

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 :).

Comment
Add comment · Show 7 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image DMCH · May 20, 2013 at 02:32 PM 0
Share

Got the same issue. Commented out all time.timescale. If I hadn't seen this answer, the next step was to start pulling out my hair one strand at a time. Thanks!

avatar image bateleur · Aug 13, 2014 at 10:18 AM 5
Share

I managed to cause this effect not via a hotkey but by quitting Unity when a scene was running which had set Time.timeScale to 0.

avatar image franky1993 · Aug 16, 2014 at 02:40 AM 0
Share

It's work. Thank you very much!!!

avatar image Kadziel · Sep 04, 2019 at 12:31 AM 1
Share

Hello from the future! hotkey pixie is still alive and as annoying as ever. Thank you so much!

avatar image huulong · Sep 19, 2019 at 09:59 PM 0
Share

It happened to me after upgrading an old Unity 5 project to Unity 2018 (although I had an intermediate step on Unity 2017). It caused all animators to stop and logged error: "Invalid time range for Transition exit time condition".

In the Project Settings > Time, I had: - Fixed Timestep: 0.0001 - $$anonymous$$aximum Allowed Timestep: 0.0001 - Time Scale: -8.68805e-44 (!) - $$anonymous$$aximum Particle Timestep: 0.03

Show more comments
avatar image
3

Answer by devast3d · Sep 29, 2011 at 02:26 PM

Check **Edit -> Project Settings -> Tim**e pane

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
2

Answer by henry96 · Sep 29, 2011 at 01:20 PM

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.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Kacer · Sep 29, 2011 at 01:28 PM 0
Share

This is my current fix to the problem, nothing new there.

I've only got 5 active scripts in my project at the moment, and i've been working with those scripts all day, believe me when i say that i do not set timescale to 0 anywhere :)

thanks for your time though.

avatar image henry96 · Sep 29, 2011 at 01:52 PM 0
Share

I see!!! Well, I suggest you go to Edit -> Project Settings -> Time . And check timeScale. This may not solve your problem. But it's another way to check it! :)

avatar image
2

Answer by Hotsaucehater · Oct 02, 2014 at 01:40 AM

Make sure you don't have the "Error Pause" option selected in the console.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Binxalot · Sep 01, 2013 at 08:08 PM

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
  • 1
  • 2
  • ›

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

17 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

2nd independent deltaTime and timeScale variables, or a way to mimic this? 1 Answer

Is it possible to change Time.timeScale to a value bigger than 100? 0 Answers

What's stopping 'WaitForSeconds' from working? 1 Answer

Unable to change Time.timeScale 2 Answers

I Need Help converting somthing to C# 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges