Search Unity

Button animation at 0 timeScale?

Discussion in 'UGUI & TextMesh Pro' started by RyuMaster, Oct 5, 2014.

  1. RyuMaster

    RyuMaster

    Joined:
    Sep 13, 2010
    Posts:
    468
    Is there a way to play button animation, when timeScale is set to 0? This made sense for mecanim, but for GUI its common to have it displayed, while game is paused, so I thought maybe there is build-in logic for this?
     
  2. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    3,149
    While the answer is likely "no", you should probably not use timeScale to pause the game since, as you've figured out, that keeps the player from interacting with menus etc.

    Instead of using timeScale, move the speed of all gameObjects to zero.
     
  3. RyuMaster

    RyuMaster

    Joined:
    Sep 13, 2010
    Posts:
    468
    Hmmm, thank you, maybe I should move to some custom time management class, white it is not too late.
     
  4. rakkarage

    rakkarage

    Joined:
    Feb 3, 2014
    Posts:
    683
  5. RyuMaster

    RyuMaster

    Joined:
    Sep 13, 2010
    Posts:
    468
    0_0 Oh, wow.
     
  6. JAKJ

    JAKJ

    Joined:
    Aug 17, 2014
    Posts:
    185
    Also, as stated by Unity (unless I am remembering incorrectly), setting timescale to 0 is pretty much the official and intended way to pause your game, which is why they consider it a bug if the UI doesn't work with unscaled time.
     
    StarManta and superpig like this.
  7. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    3,149
    I don't think this is the case. When timescale is set to zero, input isn't registered. When I first tried to do a pause system i used it and quickly realized it doesn't work for pausing.
     
  8. infinitypbr

    infinitypbr

    Joined:
    Nov 28, 2012
    Posts:
    3,149
    It would be nice, however, if there was a special pause class that we could use.
     
  9. JAKJ

    JAKJ

    Joined:
    Aug 17, 2014
    Posts:
    185
    They have made it clear it is supposed to work while paused, and they have asked people to post bugs when it doesn't. So you should submit a bug report with a repro-project if you can get input to stop functioning with timescale 0.
     
  10. RyuMaster

    RyuMaster

    Joined:
    Sep 13, 2010
    Posts:
    468
    <So you should submit a bug report with a repro-project if you can get input to stop functioning with timescale 0.>
    It happens for the "Animator" attached to the button only, and so it makes total sense to me now, its not a bug, as animator has 'unscaled time' option.
     
    GarthSmith likes this.
  11. ISL270

    ISL270

    Joined:
    Oct 13, 2019
    Posts:
    1
    thaaanks alot
     
  12. malhardevasthali007

    malhardevasthali007

    Joined:
    Apr 28, 2019
    Posts:
    2
    hey buddy thanks a lot first of all, but I just have one problem, it works totally fine but navigation is not proper when we use Unscaled Time. Means I prefer to set navigation to None so that I will be neet and clean transitions from Highlighted to normal or vice versa, is there any way to fix this?