- Home /
When does a rigbidbody updates position?
I'm always setting rigidbody forces and velocities in the fixedUpdate function.
What I want to know is when all the physics calculations is called? I mean, is it called right after the fixedupdate function?
Answer by _dns_ · Nov 30, 2013 at 03:22 PM
This thread should help you: http://forum.unity3d.com/threads/2606-Docs-on-calling-order-in-MonoBehaviour
EDIT: there is a more detailed answer below with code.
Thanks it does help. But I still cant solve my problem. I have a player with rigidbody and I apply forces on it and then I have a camera script that set the camera position to the player position (2D platformer). but the player always stutter when the camera moves. I tried almost everything, changing interpolation, changing fixedupdate/update/lateupdate But always eitehr the background stutter or the player stutter. do you have any solution?
attach the camera as a child of the player object, maybe?
tried that. the only difference is that the background jitters ins$$anonymous$$d of the player
I think this problem can be solved if I'll have the function that updates the rigidbody position. then I can call right after updating player position to the trackPlayer function. BTW, if you open the 2d platformer example that unity made, it has the same problem
Do you have several rigid bodies in your scene? What are your stats telling you? Can you take a picture of the stats and post it in your question?