Demigiant Forum

Unity Assets => DOTween & DOTween Pro => Topic started by: Bulwark Studios on May 10, 2015, 01:51:52 PM

Title: Override the timeScale / Multiple timeScale for inGame and UI
Post by: Bulwark Studios on May 10, 2015, 01:51:52 PM
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!
Title: Re: Override the timeScale / Multiple timeScale for inGame and UI
Post by: Daniele 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:
Cheers!
Title: Re: Override the timeScale / Multiple timeScale for inGame and UI
Post by: Bulwark Studios on May 11, 2015, 11:46:20 AM
Indeed!
I will do that.

Thanks a lot!