Alright so, chances are I might just have blundered with the implementation but LeanTween doesn’t seem to be able to tween timeScale to a higher value. It’s able to tween to a lower value eg. 1f to 0.75f but it doesn’t seem to go from 0.75f to 1f.
The code uses a var to hold a LeanTween ID that is only used in a single instance in the code for cancelling the tween, I tested this one spot where it can potentially do so and it was not the cause of the issue. The prints show that the ID is valid both when it’s initially declared as TweenID and when it’s saved as CurrentTimeScaleEndTweenID.
The issue at first glance also doesn’t seem to be the result of the timeScale already being lower since setIgnoreTimeScale is set to true and the .id at the end doesn’t seem to be causing issues either because it works just fine with other occurrences in the script with that same format.
Additionally there aren’t any errors shown for this, the only thing that showed up in the console was the print functions.
I’m looking at that Leantween.value() call… the first argument is just a float.
Passing in Time.timeScale doesn’t let the guy inside change it. That’s not how passing floats works. It would need to be passed by ref if you contemplated it being changed in there.
Are you hooking some other set-timescale kinda callback on there that I’m just not seeing?
You might want to go read more about that Leantween.value method. I just don’t think it works like you imagine above.
it definitely is a lot of extra complexity, but that’s what I’m going for here. this is part of a general-purpose slowmo script I’m writing with some degree of flexibility.
the idea of just mimicing a tween with math does sound like an option but that’s really only going to replicate a basic Linear tween unless I manually wrote in the math for the other types ( which I am most likely not experienced enough to do )
unity also returned an error ( which it didn’t previously ) now stating that it “cannot convert from ‘float’ to ‘UnityEngine.GameObject’”, makes sense given that LeanTween.value seems to require a GameObject to even use.
it also turns out I made a blunder in another part of the code which made me assume it worked one way but not the other, instead it just doesn’t do it at all.
extra note:
I completely overlooked this bit by the way
.setEase(LeanTweenType.linear)
it was written as just a Linear tween when it was actually meant to contain a variable containing a LeanTweenType so the type could be interchanged