1
DOTween & DOTween Pro / DOTween.To and timescale
« on: July 08, 2015, 03:46:10 PM »
Hi there !
First of all I want to thank you for this amazing tool, it's a part of Unity for me
I have some weird issue here. I'm using DOTween.To to shake an object (I know there is a function for that, but that's not the point of the subject), and while the tween is running I set the timeScale to 0. The problem is that the tween will never stop running and calling my function. I'm using an OnUpdate callback to call my function which is shaking my object. I've set the SetUpdate to Late and I let the option to be not timeScaleIndependant.
Here is the line:
If I set the timeScale at 0 before launching the tween, it won't start, otherwise it won't stop.
Is there anything I can do to fix that? Thanks !
Edit: I made a workaround, I multiply the shake value with Time.timeScale on my callback. It works, but I would assume that the callback should not be called if the TimeScale is set at 0, and called half a time when the TimeScale is set at 0.5.
First of all I want to thank you for this amazing tool, it's a part of Unity for me
I have some weird issue here. I'm using DOTween.To to shake an object (I know there is a function for that, but that's not the point of the subject), and while the tween is running I set the timeScale to 0. The problem is that the tween will never stop running and calling my function. I'm using an OnUpdate callback to call my function which is shaking my object. I've set the SetUpdate to Late and I let the option to be not timeScaleIndependant.
Here is the line:
Code: [Select]
tweener = DOTween.To(() => this.currentShakeIntensity, (x) => currentShakeIntensity = x, valueObjective, time).SetEase(currentAnimationCurve).SetUpdate(UpdateType.Late).OnUpdate(ShakeObj).OnComplete(StopShaking);
If I set the timeScale at 0 before launching the tween, it won't start, otherwise it won't stop.
Is there anything I can do to fix that? Thanks !
Edit: I made a workaround, I multiply the shake value with Time.timeScale on my callback. It works, but I would assume that the callback should not be called if the TimeScale is set at 0, and called half a time when the TimeScale is set at 0.5.