Demigiant Forum
Unity Assets => DOTween & DOTween Pro => Topic started 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!
-
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) (http://dotween.demigiant.com/documentation.php?api=SetUpdate), which makes them Unity-timeScale independent (but not DOTween-timeScale independent)
Cheers!
-
Indeed!
I will do that.
Thanks a lot!