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

DOTween still updates for a single frame after cancelling the token. #468

Closed
brantkings opened this issue May 22, 2023 · 2 comments
Closed

Comments

@brantkings
Copy link

brantkings commented May 22, 2023

Doing something like this:

TweenValues values = GetTweenValues(on);

  Tween t = DOTween.To(Get,Set, values.final, values.duration).SetUpdate(values.unscaled);

  if (values.ease != Ease.Unset) t.SetEase(values.ease);

  else t.SetEase(values.curve);

  await t.ToUniTask(TweenCancelBehaviour.KillAndCancelAwait, cancellationToken);

And after cancelling cancellationToken, the tween still Set()s for one frame. Any fix for this?

My fix was checking token.IsCancellationRequested on every Set(). Is that expected?

@yellowisher
Copy link
Contributor

Here are some workarounds. #378

@hadashiA
Copy link
Contributor

hadashiA commented Sep 8, 2023

I think #485 solved this problem.
we used CancellationToken.Register, as suggested in similar Issues, and it is now tween killed synchronously.
Thanks for the sample code and workaround info.

@hadashiA hadashiA closed this as completed Sep 8, 2023
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