interpolate.

A submission by rubic for Decade Jam 869

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.

daily creative

work on something (gamedev, art, 3d modeling, music, ...) every day

joined 1,581 days ago

2024-05
2024-04
2024-03
2024-02
2024-01

Decade Jam

To help keep members of the Decade Jam on track with their projects!

joined 1,104 days ago