Skip to content

Error in RemoveActiveTween (totActiveDefaultTweens < 0) #724

Description

@GooseOnSteroids

I dont know is it still relevant but I got message in the console to contact @Demigiant so Im here.
I get these 3 errors in my console

DOTWEEN ► Error in RemoveActiveTween (totActiveDefaultTweens < 0). It's been taken care of so no problems, but Daniele (DOTween's author) is trying to pinpoint it (it's very rare and he can't reproduce it) so it would be awesome if you could reproduce this log in a sample project and send it to him. Or even just write him the complete log that was generated by this message. Fixing this would make DOTween slightly faster. Thanks.

  • DOTWEEN ► Error in RemoveActiveTween (totActiveTweens < 0)
  • DOTWEEN ► Error in RemoveActiveTween (totActiveSequences < 0)

To reproduce them you should create empty 2d project with single sprite renderer in front of camera and attach next script to it:

public class Blink : MonoBehaviour {
[SerializeField] SpriteRenderer colorTile;
Color originalColor;
Sequence doubleBlinkColorSequence;
bool isDoubleColorBlinkActive = false;
float durationOfOneBlinkDuringDoubleBlink = 1;
float pausesBetweenDoubleBlink = .24f;
void Awake()
{
originalColor = colorTile.color;
DoubleBlinkColor(.2f);
}

void OnDestroy()
{
    CancelDoubleBlinkColor();
}

public void DoubleBlinkColor(float pauseBeforeStart, Action onComplete = null)
{
    doubleBlinkColorSequence = GetColorBlinkSequence(durationOfOneBlinkDuringDoubleBlink, Color.white)
        .Append(GetColorBlinkSequence(durationOfOneBlinkDuringDoubleBlink, Color.white))
        .AppendInterval(pausesBetweenDoubleBlink)
        .SetDelay(pauseBeforeStart, false)
        //.PrependInterval(pauseBeforeStart)
        .SetLoops(int.MaxValue)
        .OnComplete(() =>
        {
            colorTile.color = originalColor;
            doubleBlinkColorSequence = null;
            isDoubleColorBlinkActive = false;
            onComplete?.Invoke();
        });
    isDoubleColorBlinkActive = true;
    doubleBlinkColorSequence.Play();
}

public void CancelDoubleBlinkColor()
{
    if (isDoubleColorBlinkActive)
    {
        doubleBlinkColorSequence?.Complete();
    }
}

Sequence GetColorBlinkSequence(float blinkTime, Color blinkColor) {
    return DOTween.Sequence().Append(colorTile.DOColor(blinkColor, blinkTime / 2))
        .Append(colorTile.DOColor(originalColor, blinkTime / 2));
}

}

Then you should start game and press square button to stop play mode while blink is active and color of sprite renderer changing.

Unity version: 6000.3.2f1
DOTween version: 1.2.825

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