Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird bugs from .setIgnoreTimeScale(false) #174

Open
ulissesnascim opened this issue Mar 7, 2022 · 2 comments
Open

Weird bugs from .setIgnoreTimeScale(false) #174

ulissesnascim opened this issue Mar 7, 2022 · 2 comments

Comments

@ulissesnascim
Copy link

ulissesnascim commented Mar 7, 2022

Hello. I'm an everyday user of LeanTween in my projects. I noticed a weird bug. It appears that some LT commands glitch heavily when using .setIgnoreTimeScale(false). Of course, you may not use it, but it's important to report.

I opened a brand new project, added a simple TextMeshPro object to an Overlay Canvas. I added a CanvasGroup to it. The following does not work. If I comment out the .setIgnoreTimeScale line, it works.
`
public class LeanTweenTest : MonoBehaviour
{
[SerializeField] private CanvasGroup canvasGroup = default;
[SerializeField] private float duration = 0.15f;
[SerializeField] private float startingAlpha = 0f;
[SerializeField] private float targetAlpha = 1f;
[SerializeField] private bool ignoreTimeScale = false;

private int currentTweenId;

private void Start()
{
    LeanTween.cancel(currentTweenId);

    currentTweenId = 
        LeanTween.alphaCanvas(canvasGroup, targetAlpha, duration).setFrom(startingAlpha)
        .setLoopPingPong()
        .setIgnoreTimeScale(ignoreTimeScale)
        .uniqueId;
}

}
`

Of course, I will work around it for now, but I thought it was worth pointing out.

This was tested on an URP project in Unity 2020.3.13f1.

@basisbit
Copy link

basisbit commented Mar 7, 2022

The software developer of LeanTween stopped responding here at GitHub end of 2018

@pmurph0305
Copy link

For anyone else having this issue, in LtDescr.cs, this is caused by the setIgnoreTimeScaleMethod setting this.usesNormalDt to false instead of !useUnscaledTime. It should be:

	public LTDescr setIgnoreTimeScale( bool useUnScaledTime ){
		this.useEstimatedTime = useUnScaledTime;
		this.usesNormalDt = !useUnScaledTime;
		return this;
	}

the same issue appears in the setUseEstimatedTime, and setUseFrames, and setUseManualtime which also automatically sets this.usesNormalDt = false instead of the appropriate value given the passed in parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants