From e6710278e138f9e880332d596714fd224cc2f7d0 Mon Sep 17 00:00:00 2001 From: skalogryz Date: Wed, 19 Feb 2025 02:47:16 -0500 Subject: [PATCH 1/2] adjusting the delay and checking the delay is over at the same frame. This allows to retain deltatime in passed. --- Assets/LeanTween/Framework/LTDescr.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Assets/LeanTween/Framework/LTDescr.cs b/Assets/LeanTween/Framework/LTDescr.cs index 80eb3208..a565b474 100755 --- a/Assets/LeanTween/Framework/LTDescr.cs +++ b/Assets/LeanTween/Framework/LTDescr.cs @@ -972,6 +972,10 @@ public bool updateInternal(){ dt = LeanTween.dtManual; } + if(this.delay>0f){ + this.delay -= dt; + } + // Debug.Log ("tween:" + this+ " dt:"+dt); if(this.delay<=0f && directionLocal!=0f){ if(trans==null) @@ -1010,8 +1014,6 @@ public bool updateInternal(){ return isTweenFinished; } - }else{ - this.delay -= dt; } return false; From a905b111e77b5461f1c773cbf4ff8c576798ec89 Mon Sep 17 00:00:00 2001 From: skalogryz Date: Wed, 19 Feb 2025 02:59:23 -0500 Subject: [PATCH 2/2] the more accurate delta time adjustment. only using the overwaited time --- Assets/LeanTween/Framework/LTDescr.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Assets/LeanTween/Framework/LTDescr.cs b/Assets/LeanTween/Framework/LTDescr.cs index a565b474..bd5249ed 100755 --- a/Assets/LeanTween/Framework/LTDescr.cs +++ b/Assets/LeanTween/Framework/LTDescr.cs @@ -974,6 +974,9 @@ public bool updateInternal(){ if(this.delay>0f){ this.delay -= dt; + if (this.delay <= 0f) + // the actual delta time that "passed" should be + dt = -this.delay; } // Debug.Log ("tween:" + this+ " dt:"+dt);