Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by leralonde · Jan 14, 2017 at 02:49 PM · time.deltatimecountdowntime.timescale

use Time.timescale = 0 with time.deltatime problem

Hi , i need countdown for start game.Time.timescale is "0" when the game start.Therefore my countdown not working.

Could you help me ?

 public bool isGameStart=false;
 private float gameStartTime=3.0f;
 public Text timerText;
 
 void Update(){
 GameStart();
 }
 
 private void GameStart(){
             
             gameStartTime -= Time.deltaTime;
             timerText.text = gameStartTime.ToString ("0");
 
             if (!isGameStart) {
 
                 Time.timeScale = 0;
             } else
                 Time.timeScale = 1f;
             
             if (gameStartTime <= 0) {
                 isGameStart = false;
             }
 
         }
 
Comment
Add comment · Show 3
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 ownerfate · Jan 14, 2017 at 05:06 PM 1
Share

i don't use the timeScale, mainly because if it is = 0 it stops all the update frames.

because it was set to 0 once, it paused the game, and everything else.

avatar image leralonde ownerfate · Jan 15, 2017 at 02:24 AM 1
Share

Thank you for answer.I understand , i should only use for toggle pause

avatar image ownerfate leralonde · Jan 15, 2017 at 11:54 AM 0
Share

[ anytime ]

I don't know of a way, at the moment to get the result, but there may be ways to get the result you're looking for without pausing the whole editor.

i would look up a few terms dealing with pausing a scene without it affecting the entire editor's update frames, so you can achieve your goal.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by KoenigX3 · Jan 15, 2017 at 05:51 PM

Time.unscaledDeltaTime is unaffected by timeScale, you can use that instead.

Comment
Add comment · Show 1 · 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 leralonde · Jan 17, 2017 at 06:36 PM 0
Share

thank you for answer , i will try

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

88 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 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 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 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 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 avatar image avatar image avatar image

Related Questions

Countdown variable modified with deltaTime continuously being reset 1 Answer

How to Make Timer (Score) Count Up Faster? 1 Answer

Why is my Unity Game crashing whenever Time Left is close to 0? 0 Answers

Is Time.deltaTime different on various devices? 0 Answers

Slow Motion Issues! 1 Answer


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