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

WaitForCompletion stuck on recycled tween #675

Open
Andarium opened this issue Feb 21, 2024 · 0 comments
Open

WaitForCompletion stuck on recycled tween #675

Andarium opened this issue Feb 21, 2024 · 0 comments

Comments

@Andarium
Copy link

Description:
Creating new tweens while yielding WaitForCompletion can cause some WaitForCompletion to never end.
Reproduced only when tween recycling is on (global or per-tween).
Tweens associated with stuck WaitForCompletion are the same (by hash code) that were recycled and reused by other animation script instance.

Steps to reproduce:

  1. Create scene with some 3d objects (11 cubes in my case)
  2. Add same animation script below to these 3d objects
  3. Start Play Mode

Expected:
All 3d object moving synchronously

Actual:
Some 3d objects not moving, stuck on WaitForCompletion.

Reproduced:
Unity 2023.2.10f1 with DOTween 1.2.745 and 1.2.765
Unity 2022.3.17f1 with DOTween 1.2.745

Settings:
Recycable: true
Safe Mode: false
AutoPlay: false
AutoKill: true

Sample code:

using System.Collections;
using DG.Tweening;
using UnityEngine;

public sealed class Animation : MonoBehaviour
{
    private IEnumerator Start()
    {
        yield return transform.DOLocalMoveY(0, 0.5f)
            .SetRecyclable(true)
            .Play()
            .WaitForCompletion();

        transform.DOLocalMoveY(1, 1)
            .SetLoops(-1, LoopType.Yoyo)
            .SetRecyclable(true)
            .Play();
    }
}
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

1 participant