Skip to content

Weird bugs from .setIgnoreTimeScale(false) #174

Description

@ulissesnascim

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.

Activity

  1. basisbit commented on Mar 7, 2022

    @basisbit

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

  2. pmurph0305 commented on Oct 7, 2022

    @pmurph0305

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions