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

SetDelay is appending interval between two tween Joined in sequence #683

Open
MeetArgon opened this issue May 24, 2024 · 2 comments
Open

Comments

@MeetArgon
Copy link

MeetArgon commented May 24, 2024

I have issue where I loop through the list of transforms I want to scale them from 0 to their original scale with all tween start at same time but play after random delay but SetDelay is appending interval between two tween Joined in sequence. So all the transform tween are playing on after another.

public void AnimateBoard(Action callBack)
       {
           Sequence sq = DOTween.Sequence();
           int count = 0;
           for (int rank = 0; rank < 8; rank++)
           {
               for (int file = 0; file < 8; file++)
               {                 
                   Transform tr = squareRenderers[file, rank].transform;
                   Vector3 endScale = tr.localScale;
                   tr.localScale = Vector3.zero;
                   Tween tween = tr.DOScale(endScale, 0.2f).SetDelay(UnityEngine.Random.Range(0f, 0.5f));
                  
                 
                
                   sq.Join(tween);
               }
           }
           sq.Play().OnComplete(() =>
           {
               callBack?.Invoke();
           });
       }
@Monsoonexe
Copy link

Try sq.AppendInterval(...) after sq.Join to make the interval a part of the sequence and not part of the tween.

@MeetArgon
Copy link
Author

@Monsoonexe I don't want tweens in sequence to play one after another I want them to play at same time but with their own individual delays.

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

2 participants