I want to set a delay after every dotween loop. Onstepcomplete method doesn't seem to work with Ienumorator and SetDelay method delay at the start of the Tween. How do I it?
void Movement()
{
transform.DOPath(path, moveduration, pathType, pathMode, 10).SetLoops(-1, LoopType.Yoyo).SetEase(ease).SetDelay(startdelay)
.OnStepComplete(StartCoroutine(Wait()));
}
private IEnumerator Wait()
{
yield return new WaitForSeconds(delay);
}
You need to put your tween in a sequence to do what you want.
DOTween.Sequence().SetDelay(1f).Append(transform.DOPath(XXX).OnComplete(XXX)).AppendInterval(1f).SetLoops(-1, LoopType.Yoyo).Play();