Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 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 /
  • Help Room /
avatar image
7
Question by BeB_Wir3 · Aug 11, 2017 at 07:32 AM · c#uianimatortimescale

Timescale Pause Combined with Animated UI

the passed days i've been creating my game, and set up the hole game with GUI. now i switched to UI since it is super cool stuff. Now i stumbled upon the fact that when i pause the game, i use Time.timeScale = 0.0F; so everything freezes. it didn't effect the GUI buttons. now i changed everything to UI, and the animation freezes allong with the rest of the game, which is normal, but how do i have to work arround it? i did stumble upon something called "realtimeSinceStartup" but i have no idea if it is a good salution or how to set it up. thanks in advance.

also, i managed all the menus in 1 animator which starts at the start of the scene. i could change it, but just so you know.

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 digzou · May 04, 2015 at 05:51 AM 0
Share

You could try using iTween to animate the elements with "ignoreTimeScale" property.

avatar image BeB_Wir3 · May 04, 2015 at 09:53 AM 0
Share

thanks for the awnser, but i dont want to use external stuff if the existing animation is very good in unity itself. I cant be the only one who has stubled upon this problem and i cant imagine that there wouldn't be a simple fix within unity itself. so sorry and thanks?

avatar image NathanHold · May 04, 2015 at 01:16 PM 0
Share

See here. It shows that the only thing not paused is realtimeSinceStartup and so is the best thing to use for things that ignore the time scaled deltaTime.

This forum thread talks about how to go about doing that. For book-keeping I have added the relevant snippet of code that Tuhljin wrote.

 public class Timekeeper : $$anonymous$$onoBehaviour {
     private float prevRealTime;
     private float thisRealTime;
  
     void Update () {
         prevRealTime = thisRealTime;
         thisRealTime = Time.realtimeSinceStartup;
     }
    
     public float deltaTime {
         get {
             if (Time.timeScale > 0f)  return  Time.deltaTime / Time.timeScale;
             return Time.realtimeSinceStartup - prevRealTime; // Checks realtimeSinceStartup again because it may have changed since Update was called
         }
     }
 }

avatar image BeB_Wir3 · May 07, 2015 at 09:45 AM 0
Share

thank you for the comment. but sadly enough, my problem is not that i cant call anything. the animations of the menu's freeze along with the timescale. which is completely normal and understandable, but i don't want it! meanwhile i found this http://answers.unity3d.com/questions/32753/ideas-for-animating-while-paused.html but i cant seem to get it working..

1 Reply

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

Answer by BeB_Wir3 · May 07, 2015 at 02:03 PM

I found the salution! I found it here http://www.adventurecreator.org/forum/discussion/2257/pause-menu-not-affecting-the-menu-animation

and it accualy pritty simple, and i cant imagine i didn't find this sooner.. salution, as a quote!

SilverVoo February 11 edited February 11

If you are using "time.timeScale = 0" for pause, then this must help;

Choose button/canvas/etc that you need -> Animator -> Update Mode -> Unscaled Time

hope it will help anyone.

Comment
Add comment · Show 6 · 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 SlattyNaN · Apr 20, 2016 at 09:12 PM 1
Share

Spent hours looking at various scripts to manage this! All along a simple option was there!!!

Thanks

avatar image HIST0R · Jul 26, 2016 at 02:01 PM 0
Share

$$anonymous$$e too :D and it's so easy. Thanks!

avatar image dugmcdug · Nov 30, 2016 at 06:39 AM 0
Share

It took several googles and multiple incorrect answers before I found this perfect answer! Animated UI while game is paused. Thanks!

avatar image Active-Studio-Games · Feb 04, 2017 at 06:30 PM 0
Share

well, i'm not using the animations for the UI button but just color transition, how can i fix the problem with time scale??? :(

avatar image Bonfire-Boy Active-Studio-Games · Feb 04, 2017 at 10:18 PM 0
Share

One option would be to find another way of pausing your game. If you want some things to be affected by time and others not to be, then taking complete control of the issue yourself may be the best way to go.

avatar image BusyRoots · Mar 10, 2020 at 09:50 AM 0
Share

Thanks a bunch :)

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

14 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

Related Questions

Character selection process 1 Answer

How can I hide all the elements inside of a canvas? 1 Answer

Animator consecutive set parameter problem 0 Answers

Is UI affected by time scale ? 1 Answer

Need components for script... 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