Tween sequence does not call onComplete every time
Versions: Unity 2019.4.13f1 and DOTween v1.2.420
Bug: The fadeSecquence below does not call onComplete (FadeComplete) 100% of the time.
Reproduce: Instantiate a new GameObject with the component below and let the animations run (assign the text variable). Instantiate the GameObjects in rapid succession e.g. from a button press. The fadeSecquence will not complete every time in my tests. If I remove the fadeSecquence and use two DOFades with delays it will work every time.
public class AnimatedText : MonoBehaviour
{
[SerializeField] TMP_Text text;
void Start()
{
Sequence fadeSecquence = DOTween.Sequence();
fadeSecquence.AppendInterval(delay);
fadeSecquence.Append(text.DOFade(1, fadeDuration));
fadeSecquence.AppendInterval(duration - fadeDuration);
fadeSecquence.Append(text.DOFade(0, fadeDuration));
fadeSecquence.onComplete = FadeComplete;
gameObject.transform.DOMoveY(10, 2).onComplete = MoveComplete;
}
void MoveComplete()
{
}
void FadeComplete() // This is not called 100% of the time
{
}
}
If I change the fadeSecquence to the below code it works 100% of the time:
text.DOFade(1, fadeDuration).SetDelay(delay);
text.DOFade(0, fadeDuration).SetDelay(duration - fadeDuration).onComplete = FadeComplete;
Additionally if I remove the DOMoveY it also works 100% of the time.
Glad to give more info if needed.
+1
+1