dotween icon indicating copy to clipboard operation
dotween copied to clipboard

Dotween Execution Order not Aligning with Coroutines

Open amaljoy opened this issue 1 year ago • 0 comments

Hi, I am kind of bit confused here. Why debug.log in IEnumerator is printing first than the one in sequence.Onstart. Is there a way to execute tween in current execution order? It is really important in my current project to make it execute in correct order. ` using DG.Tweening; using System.Collections; using System.Collections.Generic; using UnityEngine; using DG.Tweening;

public class Follower : MonoBehaviour { private void Update() { if (Input.GetKeyDown(KeyCode.Space)) { PlayAnim(); StartCoroutine(Example()); }

}
IEnumerator Example()
{
    Debug.Log("Function started");
    yield return new WaitForEndOfFrame();
}

Sequence sequence;
public void PlayAnim()
{
    sequence = DOTween.Sequence();
    sequence.OnStart(() => { Debug.Log("Sequence started"); });
    sequence.Play();
}

} `

amaljoy avatar Sep 14 '24 15:09 amaljoy