Demigiant / dotween

A Unity C# animation engine. HOTween v2
http://dotween.demigiant.com
Other
2.29k stars 344 forks source link

Tween scale with delay - set to 0 at start #651

Closed wrymn closed 10 months ago

wrymn commented 10 months ago

I have 4 buttons image

I want to tween them from scale 0 to scale 1, each with delay. So

Button 1: delay 0.3s Button 2: delay 0.6s Button 3: delay 0.9s Button 4: delay 1.2s

e.g.: image

However, when I disable the buttons (e.g. when game options are opened, buttons are disabled) then re-enable them again, they are of scale 1 by default, and then start to animate from 0 to 1 with tween.

How to achieve, so every time these buttons are enabled, their scale is set to 0 (so they are not visible at start) and then the delay tweens can then start animating them from 0 to 1?

I tried this, but it just won't work, it seems that tweens with duration of 0 just dont play at all: image

Edit: documentation does not mention this how to do it, at least I couldn't find it

wrymn commented 10 months ago

Solved by upgrading to new version of DoTween and setting OnEnable manager to Restart from spawn point