- Home /
Run some code just after physics is calculated
I would like to run some code just after the physics is calculated.
For example, a result rigidbody2D velocity of an object is 1,0 I would like to set it to 0,0 before it will affect any physics calculations of any surrounding objects.
Is there any way how to do this?, or are all physics calculations performed before calling the Update function for any object?
Comment
Answer by tanoshimi · Dec 14, 2014 at 08:38 PM
Physics calculations are done in FixedUpdate. You can try using LateUpdate, which is called after Update (although not strictly in sync with FixedUpdate, it will have resolved values of any objects affected by Physics in that frame).