Submissions from 2022-05-19 to 2022-05-20 (1 total)

i started asking myself how it's possible, in general, for a physics engine to be useful when it updates itself at a lower framerate than the computer actually displays it. but then, in the morning, i googled "unity physics timestep 144" and it immediately occurred to me that the answer was probably super plain.

so my issue here is that sometimes, two Update frames in a row, the physics objects haven't actually updated from point A to point B through FixedUpdate yet. so they jitter, because i see two frames of the object still at point A. what if, the moment i wanted the physical position of everything in the scene, the physics engine could intelligently return the position of the object somewhere between points A and B?

in other words, i went and turned the "Interpolate" option on for the player's rigidbody. this setting would make any physics object report its position as an interpolation between every point the physics system actually updates... which solves every single one of these problems. sure, a lower fixed timestep would result in more and more inaccurate physics calculations. but 1/60th a second is comfortable and everything now looks very smooth.