- Home /
How to smooth physics without interpolation
I'm making a game that is almost entirely driven by physics, and am having significant problems with jerkiness caused by fixedupdate() and update() not being in sync.
Interpolation doesn't play nicely with my game (it affects the control of the main character) so isn't an option.
I'm developing for iOS and Android and am targeting 60fps, so my current workaround has been to set the fixed timestep to 0.016666667 (60 steps per second).
So, my question is, is there an obvious / standard way to deal with this that I'm missing? Or, is there a major downside to hack I'm employing above?
A downside that I could think of is if your device runs faster/slower than 60fps, then they will be out of sync again. Why would you want fixedUpdate and update to be in sync in the first place? Can you use coroutines to alleviate the jerkiness?
Yep, that definitely is a downside - they're never totally in sync for long so even though the motion is mostly smooth, you can tell something isn't right.
Sorry, I'm not sure I understand - how would coroutines help here?
With the limited information you provided, I'm just throwing things on the table. Depending on your problem, you could start a coroutine in FixedUpdate that lerps your values until the next FixedUpdate, or something.
Update is managing control inputs, playing animations etc. FixedUpdate is applying all rigidbody forces etc.
This is a good discussion around the fundamental issue: http://answers.unity3d.com/questions/275016/updatefixedupdate-motion-stutter-not-another-novic.html
However I'd like to find a solution without using interpolation.
Your answer
Follow this Question
Related Questions
Framerate independent physics (FixedTimestep, FixedDeltaTime) 1 Answer
does interpolation full up some kind of cache over time 1 Answer
Unity Physics frame rate. void FixedUpdate 3 Answers
Interpolating positions between FixedUpdate frames? 1 Answer
Physics behaviour changing with framerate - Is FixedUpdate() actually working properly? 3 Answers