Hi!

I have a speed control in my game (0.5x, 1x, 2x 4x, ...).
I'm using the DOTween.timeScale to speed up or slow down all of my tweens. And it works like a charm.
But I also use tweens for my UI part which I want the timescale set to 1.

There is a best practice to do that ?

I found a workaround: I'm setting the timeScale for each tween in a LateUpdate. (Still have a problem with a DOTween.timeScale = 0f)
void LateUpdate() {
        tween.timeScale = 1f / DOTween.timeScale;
}

Maybe i'm missing something there is a better way to do that ?

Thanks a lot!

*

Daniele

  • Dr. Admin, I presume
  • *****
  • 378
    • View Profile
    • Demigiant
Re: Override the timeScale / Multiple timeScale for inGame and UI
« Reply #1 on: May 10, 2015, 06:48:42 PM »
Hi!

If you want to scale all your game's animations (tweens but also anything else you might have) except the UI, the best approach would be to:
  • use Unity's Time.timeScale (instead of DOTween.timeScale) to set the speed of the game
  • create the UI tweens by adding SetUpdate(true), which makes them Unity-timeScale independent (but not DOTween-timeScale independent)
Cheers!

Re: Override the timeScale / Multiple timeScale for inGame and UI
« Reply #2 on: May 11, 2015, 11:46:20 AM »
Indeed!
I will do that.

Thanks a lot!