Demigiant / dotween

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

From(setImmediately: false) only works on the first iteration of a sequnce #560

Open thsbrown opened 2 years ago

thsbrown commented 2 years ago

I have the following code

dotSequence = DOTween.Sequence();
foreach (var dot in dots)
{
    dotSequence.Append(dot.transform.DOScale(startScale, dotScaleDuration).From(dotScale,false));
}

dotSequence.SetLoops(-1);
dotSequence.Play();

Everything seems to be working correctly on the first iteration, however on consecutive iterations it looks as though the setImmediately: false flag is not being respected in From(...) on consecutive sequence iterations.

See example below

E1CC966A-0788-4A18-A671-D57168A045A5

What I expect to happen is the first iteration (with the "beeping dots") continues to happen on consecutive iterations.

Thanks so much in advance! Really love the asset!

thsbrown commented 2 years ago

Just a quick follow up. The way I've got around this issue currently is using the following code

public async void Play()
{
    DotsPlaying = true;
    while (DotsPlaying)
    {
        dotSequence = DOTween.Sequence();
        foreach (var dot in dots)
        {
            //updated to latest DOTween so no longer need to specify from value
            dotSequence.Append(dot.transform.DOScale(dotScale, dotScaleDuration).From(false,false));
        }
        dotSequence.Play();
        await dotSequence.AsyncWaitForCompletion();
    }
}