You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I was doing some tests with Sequences to see if PrimeTween could replace DoTween in my project, and surprise—on the very first try, I ran into a possible bug.
Here’s the test code I used:
public Image barA;
public Image barB;
Sequence sq;
public void AnimateSequence()
{
if (sq.isAlive)
{
Debug.Log("Sequence is Alive");
return;
}
var tA = Tween.UIFillAmount(barA, 0, 1, 2);
var tB = Tween.UIFillAmount(barB, 0, 1, 2);
sq = Sequence.Create()
.ChainCallback(() => Debug.Log("A"))
.Chain(tA)
.ChainCallback(() => Debug.Log("B"))
.ChainDelay(2)
.ChainCallback(() => Debug.Log("C"))
.Chain(tB)
.ChainCallback(() => Debug.Log("D"));
}
private void Update()
{
if (!sq.isAlive)
{
AnimateSequence();
}
}
It's about two Images that fill up in sequence, one after the other with a delay in between, and a few Logs along the way.
If we set the Fill value of both Images to 0 in the scene and then hit Play to start the test, the first time the bars fill up as expected.
However, on subsequent plays, the second bar remains filled from the beginning of the sequence (meaning it doesn't reset).
You can fix it with a small trick right after creating the Sequence to get the expected behavior. It seems like the system isn’t evaluating the full sequence before starting it—and doing this trick forces the internal tweens to evaluate.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I was doing some tests with Sequences to see if PrimeTween could replace DoTween in my project, and surprise—on the very first try, I ran into a possible bug.
Here’s the test code I used:
It's about two Images that fill up in sequence, one after the other with a delay in between, and a few Logs along the way.

If we set the Fill value of both Images to 0 in the scene and then hit Play to start the test, the first time the bars fill up as expected.


However, on subsequent plays, the second bar remains filled from the beginning of the sequence (meaning it doesn't reset).

You can fix it with a small trick right after creating the Sequence to get the expected behavior. It seems like the system isn’t evaluating the full sequence before starting it—and doing this trick forces the internal tweens to evaluate.
On the other hand, if we configure the same sequence to run in Restart cycles, the expected behavior is properly observed.
sq = Sequence.Create(cycles: 2, cycleMode: CycleMode.Restart)I hope the effort I put into testing and writing this helps improve PrimeTween. Thank you very much for your time.
Beta Was this translation helpful? Give feedback.
All reactions