Problem with multiple OnComplete functions
« on: November 23, 2015, 10:57:03 AM »
I'm having an issue with OnComplete in Tweens (not sequences).
When I use .OnComplete function and a DoVirtual.DelayedCall inside the function, this is delayedcall never happen.
I think it must be something related to a number of limits in calls ,like a stack limit.
Can you confirm this please?

example:
transform.DOMoveX(2f, 1f).OnComplete(() => { DOVirtual.DelayedCall(1f, () => { transform.DOMoveX(0f, 1f).OnComplete(() => { Debug.Log("Position 0"); }); });  });

that works perfectly but there is some cases ,more complicated , when the delayedcall is not working, when the amount of subsequent calls increases.

*

Daniele

  • Dr. Admin, I presume
  • *****
  • 378
    • View Profile
    • Demigiant
Re: Problem with multiple OnComplete functions
« Reply #1 on: November 23, 2015, 12:00:37 PM »
Hi,

I never thought of using DelayedCalls inside an OnComplete callback, that is interesting. But no, there is no limit on calls. Can you write me an example of a non-working version, so I can test it out and see what's happening?

By the way, why are you using this approach and not a Sequence? Just as a note, a Sequence would be slightly more performant.

Cheers,
Daniele