Demigiant / dotween

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

SetSpeedBased In Sequence is not useful #592

Closed wujiaze closed 2 years ago

wujiaze commented 2 years ago
 private Sequence seqChange;
 void Update()
    {
    if (Input.GetKeyDown(KeyCode.Space))
        {
            if (seqChange != null)
            {
                seqChange.Kill(false);
                seqChange = null;
            }
            seqChange = DOTween.Sequence();
            Tweener tweenr1 = cubeTrans.DOMoveX(5, 3).SetSpeedBased().SetEase(Ease.Linear);
            Tweener tweenr2 = cubeTrans.DOMoveX(0, 3).SetSpeedBased().SetEase(Ease.Linear);
            seqChange.Append(tweenr1);
            seqChange.Append(tweenr2);
        }
    }

If I click KeySpace a couple of times quickly, it's not moving by speedbase

Demigiant commented 2 years ago

Ahoy! SetSpeedBased is one of the Tweener-specific settings that won't work when inside a Sequence, sorry (Sequences need to know their exact duration and speedBased doesn't allow that). http://dotween.demigiant.com/documentation.php#specificSettings