dentedpixel / LeanTween

LeanTween is an efficient animation engine for Unity
608 stars 135 forks source link

LeanTween.delayedCall() is bugged/unreliable, will occasionally not perform call #177

Open JegoMx opened 1 year ago

JegoMx commented 1 year ago

We're using delayedCall() throughout our project but have noticed that every now and then (and more frequently at higher timescales) the action given to the function is not executed. The tween starts, and attaching an .setOnUpdate() method with a Debug.Log inside shows that the tween is running, until it suddenly stops for seemingly no reason.

It doesn't seem like it is getting cancelled, it just simply... stops. I have tried attaching the debugger/leaving Log calls all throughout the LeanTween class but can't seem to figure out what is causing this issue.

Needless to say this is a very frustrating issue and we're in the process of removing all calls to the bugged method. Is there some sort of setting that we might have configured wrongly, or is this truly a bug? I have found other similar bug reports on google, but those threads mention that the issue should be resolved in later updates. We're using the latest Asset Store version 2.51 on unity version 2020.3.15f2 LTS.

Eversor commented 7 months ago

Hello @JegoMx did you happen to find the culprit? I'm having the same issue with a live game and it's pretty bad. Could it be that the garbagecollector is destroying the tweens that have not completed yet? I'm having the same exact unreliability in recreating the issue. Versions are 2.51 and 2022.3.5f1

JegoMx commented 7 months ago

Hey @Eversor , unfortunately we never did, and moved to a DOTween instead. It's been a while since having this issue, but iirc it had something to do with the tweens being recycled/reused before they were actually finished.

Eversor commented 7 months ago

Yes, i can definitely confirm the issue could be that, checking the source-code there is nothing preventing to hold a reference to a cancelled and then reused tween. If one were to cancel using the reference you would cancel the new tween instead. I also moved to DOTween that is essentially overlapping all the functionalities.