Demigiant Forum

Unity Assets => DOTween & DOTween Pro => Topic started by: larykUA on May 27, 2015, 07:05:18 PM

Title: OnComplete callback does not called sometimes in v1.0.720
Post by: larykUA on May 27, 2015, 07:05:18 PM
Hello everybody!

My code is:
Code: [Select]
void MovePlayer()
{
...
DOTween.Sequence()
.Append(transform.DOLookAt(moveTo, 1, AxisConstraint.None, Vector3.up))
.Insert(0, transform.DOMove(moveTo, movingTime, false).SetEase(Ease.Linear).OnComplete(onMoveComplete));
...
}

Code: [Select]
public void onMoveComplete()
{
  ....       
}

The onMoveComplete callback does not called on Android device as well as Unity Editor.
Sometimes the callback called one time, but does not called for next DOTween.Sequence . Sometimes it does not called at all.

I do not kill or stop sequence in any way.

I do NOT have this problem with my previous 1.0.401 version of DOTween.
My Unity is the latest 5.0.2f1 .

Please help. Thanks !
Title: Re: OnComplete callback does not called sometimes in v1.0.720
Post by: Daniele on May 28, 2015, 01:50:13 PM
Hi,

Could you check if you have this same issue with v1.0.606 (you can download it from here (http://dotween.demigiant.com/download.php#changelog), just click on the "Old versions and Changelog" title to show all old versions)?

By the way, here's also a temporary fix in the meantime. I believe this error happens only if you have a nested callback (like OnComplete) that is fired at the end of a Sequence. But if you add an OnComplete to the Sequence itself that should always happen correctly.
Title: Re: OnComplete callback does not called sometimes in v1.0.720
Post by: larykUA on May 29, 2015, 06:57:49 PM
Could you check if you have this same issue with v1.0.606

Unfortunately, I can't check this version.
There are a lot errors in my Unity 5.0.2 :( You've fixed those errors in v1.0.720 only...

By the way, here's also a temporary fix in the meantime. I believe this error happens only if you have a nested callback (like OnComplete) that is fired at the end of a Sequence. But if you add an OnComplete to the Sequence itself that should always happen correctly.

Yes, you're right, seems like the below code works as it should
Code: [Select]

DOTween.Sequence()
.Append(transform.DOLookAt(moveTo, 1, AxisConstraint.None, Vector3.up))
                        .Insert(0, transform.DOMove(moveTo, movingTime, false).SetEase(Ease.Linear))
                        .OnComplete(onMoveComplete);

Thank you!