I am a unity game developer from last one year,but cannot find why unity always tell us to to all the physics related things in FixedUpdate rather then in Update or any other function.???
Even i have some idea because i am using unity,but still i dont think i have the exact answer of this question or number of benefits of this.
if any one know the reasons for this,please do reply or provide me a link where i can read this thing.
Physics runs on a fixed time step, which is what FixedUpdate correlates to, and is 50 times per second by default. Update is every frame. The two don’t generally match.
I can tell you that there is a FixedUpdate() because of the physics solver that is used. I think unity used PhysX or something like that. The reason there is a fixed time step is because the solver implemented requires each physics time step to be the same(fixed). There are variable time step techniques, but this one happens to be fixed. Update() is run more or less frequently depending on how much your application demands from the system every step. So if you have a little code, it will take very little time to execute Update(). If you have alot or poorly designed code, then it will take longer to execute Update().
So here you can see that Update() and FixedUpdate() will usually be out of sync and you should do any physics related coding within FixedUpdate()
If you were to say, add force to a rigidbody toward the end of Update(), and your Update takes 0.5 seconds to execute. Well you skipped FixedUpdate() who knows how many times. That would reduce responsiveness of controls and the like.
EDIT: If you understood how the fixed physics timestep affects the visual representation of the moved objects you might want to check this to achieve smooth movement of objects: