Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
0
Question by Geo.Ego · Oct 18, 2012 at 05:35 PM · timerspeedcountdowndeltatime

Certain timers run too fast

I'm having a strange problem with timing in only certain scenes of my build. For instance, in my Loading scene, I use the following simple method for controlling my countdown:

void Update () { timer += Time.deltaTime; if (timer >= timeToWait) { Application.LoadLevel ("MainMenu"); } }

This works fine in the Inspector and when I compile a build and run it on my development machine. However, when I move it to my production machine, it counts down very quickly; probably hitting 0 after about two or three seconds.

In another scene, I "blink" some text by looping the alpha value in a method called from Update:

 function UpdateTextAlpha()
 {
     // Fade font in proper direction.
     
     if (c.a >= 1)
     {
         fontFadeIn = false;
     }
     
     if (c.a <= 0)
     {
         fontFadeIn = true;
     }
     
     if (fontFadeIn == true)
     {
         c.a += Time.deltaTime;
     }
     else
     {
         c.a -= Time.deltaTime;
     }
 }

Again, this is fine in the Inspector and when running a build on my development machine; however, on the production machine, it is way too fast.

On the other hand, I use the first method in other scenes, and the countdown is perfect. Any idea where I'm going wrong? Thanks.

Update: I tried copying my entire scene to a new project and testing just that scene. The countdown timer runs fine when I do that.

Comment
Add comment · Show 4
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 whydoidoit · Oct 18, 2012 at 05:49 PM 0
Share

Is something setting Time.timeScale? It's certainly odd.

avatar image Geo.Ego · Oct 18, 2012 at 06:38 PM 0
Share

I thoroughly checked the three scripts that run in the loading scene, and verified that I don't change the timeScale anywhere, but just for the heck of it, I added time.Timescale = 1.0f to my loading script, and my ti$$anonymous$$g works perfectly now for that scene and the flashing text on the main menu. Bug report perhaps?

avatar image whydoidoit · Oct 18, 2012 at 06:38 PM 0
Share

Sounds like it. Hit the button :)

avatar image Geo.Ego · Oct 18, 2012 at 06:48 PM 0
Share

Lol. Done and done. Problem is fixed and bug report is submitted. Thanks for your help!

1 Reply

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

Answer by Geo.Ego · Dec 21, 2012 at 06:48 PM

I added this answer in case anyone else runs into this bug. Basically, Time.timeScale was off in any scenes that I added to this particular project. I fixed it by setting Time.timeScale = 1.0f in Start () for every one of my scripts.

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

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

10 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

Related Questions

countdown timer acivation 1 Answer

Countdown timer into text c# 1 Answer

Unity hand-made timer doesnt work? 1 Answer

How to restart a level with countdown? 4 Answers

Use timer to remove text 2 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