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

WaitForFixedUpdate does not work as described #377

Closed
Qriva opened this issue Jul 17, 2022 · 3 comments
Closed

WaitForFixedUpdate does not work as described #377

Qriva opened this issue Jul 17, 2022 · 3 comments

Comments

@Qriva
Copy link

Qriva commented Jul 17, 2022

This line from documentation is wrong:

// replacement of yield return new WaitForFixedUpdate(same as UniTask.Yield(PlayerLoopTiming.FixedUpdate))
await UniTask.WaitForFixedUpdate();

Coroutine WaitForFixedUpdate is called the same frame after physics update and when used in OnTirggerXYZ family callbacks it will correctly be called the same frame after callbacks. Unitask behaviour is different - it will be called next frame and probably at the beggining of FixedUpdate. To get the same behaviour I needed to use UniTask.Yield(PlayerLoopTiming.LastFixedUpdate);

@neuecc
Copy link
Member

neuecc commented Jul 21, 2022

Thank you very much.
After verification, I may change the implementation of WaitForFixedUpdate (since the same behavior is desirable).

@aidenatgravitysketch
Copy link

aidenatgravitysketch commented Aug 3, 2022

Please. I just came across a similar issue where a bug was introduced because I expected the behaviour to be the same.

@neuecc
Copy link
Member

neuecc commented Oct 24, 2022

released at 2.3.2.

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