Demigiant / dotween

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

Cannot rewind sequence #580

Closed rauwebieten closed 2 years ago

rauwebieten commented 2 years ago

I created a sequence, set autokill to false

    DOTween.Sequence()
        .Append(material.DOColor(color, duration))
        .Append(target.transform.DOScale(targetScale, duration))
        .SetEase(Ease.InOutElastic)
        .SetAutoKill(false);

Later on, I try to rewind the sequence by

    DOTween.Rewind(target);

But the rewind does not happen.

When I change my code to DOTween.RewindAll() it works, but this is not what I want, because it affects other tweens.

Maybe related to issue 320, looks similar https://github.com/Demigiant/dotween/issues/320

rauwebieten commented 2 years ago

Found the solution in another issue. #91

Create the sequence like this, adding the ID

    DOTween.Sequence()
        .Append(material.DOColor(color, duration))
        .Join(target.transform.DOScale(targetScale, duration))
        //.SetEase(Ease.InOutElastic)
        .SetAutoKill(false)
        .SetId(target);

And rewind by giving the ID:

    DOTween.Rewind(target);