Unity dotween delay before the next append not working
15,452
(NOTE: I'm the developer of the library the OP is talking about)
The correct way to add delays inside a Sequence is to use AppendInterval on the Sequence itself.
for (int i = 0; i < CamerasData.Count; i++) {
camSequence
.AppendInterval(CamerasData[i].triggerDelay)
.Append(cam.DOFieldOfView(CamerasData[i].fov, CamerasData[i].duration));
}
That said, SetDelay should also work in theory, even if it's not recommended. I will add it to my to-check list.
Related videos on Youtube
Author by
Tengku Fathullah
"Do the right things, and do the thing's right"
Updated on September 14, 2022Comments
-
Tengku Fathullah over 1 year
I have lists of data and I am trying to tween them by sequence. If I put a delay for each of the tween it will not work. What I try to achieve is inserting the delay before the next sequence.
private IEnumerator<float> _CameraTransition() { var camSequence = DOTween.Sequence(); for (int i = 0; i < CamerasData.Count; i++) camSequence.Append(cam.DOFieldOfView(CamerasData[i].fov, CamerasData[i].duration).SetDelay(CamerasData[i].triggerDelay)); camSequence.Play(); yield return 0; }
If I remove the
SetDelay
it works, but of course no delay-
Draco18s no longer trusts SE over 5 yearsWhile not relevant to your problem: this function, as you've written it, does not need to be a coroutine. Your
yield
instruction is the last statement, meaning that no code is left to execute after the coroutine continues afterwards.
-