- Home /
WaitForFixedUpdate coroutine happens after the internal physics update?
http://docs.unity3d.com/Manual/ExecutionOrder.html
The diagram shows that WaitForFixedUpdate happens before the internal physics update but after FixedUpdate. But from my tests, this is not true. I tried to use rigidbody.MovePosition () in a WaitForFixedUpdate coroutine but it always happens one frame after, as if it had run after the physics update
Answer by Bunny83 · Dec 01, 2015 at 03:36 AM
Yes, it seems like a bug. The order clearly is:
FixedUpdate
Internal physics update
WaitForFixedUpdate
Update
MovePosition will take immediate effect on rigidbody.position, however that position is applied to transform.position during the internal physics update. So movement applied in a coroutine will take effect after the next physics step.
Your answer
Follow this Question
Related Questions
Custom Yield Instruction for FixedUpdate frames 3 Answers
Question about WaitForFixedUpdate() 1 Answer
Tracking state changes using yield 0 Answers
NullReferenceException in nested Coroutine 0 Answers
yield WaitForRealSeconds 1 Answer