cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best way to avoid the stuttering seen on objects moved by physics?

mrgreen72
Superstar
By default, Unity's physics engine works at 60Hz and since Rift works at 90Hz, there's very noticeable stutter when using linear movement on RigidBodies. 

I can "fix" it by setting the Fixed Timestep in the Time Projects Settings so that FixedUpdate also runs at 90Hz but I'm wondering if there's a better way. I'm afraid that doing so this way could potentially kill performance. 
2 REPLIES 2

m4lumm
Protege
I have found that as long as you maintain an FPS at 90 or above, the stutter doesn't show itself. 

Interesting solutions though. I will have to give them a try. 

mrgreen72
Superstar


Hi,

I checked with our integrations team and was provided with the following guidance to share with you regarding this issue:

"That is a fine solution.
If it does cause performance issues, you can also reduce the Default Solver
Iterations and Default Solver Velocity Iterations to make each physics fixed
update cheaper. Another solution is to set the fixed update size to 22.222ms
(45Hz) or 33.333ms (30Hz) so there is a consistent number of rendered frames
between each fixed update. If you do this, be sure to set OVRCameraRig.useFixedUpdateForTracking
= true to make Touch tracking synchronize with physics instead of rendering."


Thanks for the detailed answer! I didn't expect that much to be honest. 🙂

I've found that the way you move the RigidBody makes a difference. I didn't find the exact cause but I believe it depends on the ForceMode you use on the RigidBody.AddForce.

I was using ForceMode.VelocityChange and setting Interpolate to true on the RigidBody didn't have any visible effect but setting the Fixed Timestep to 0.0111 (90Hz) in the Time settings fixed the judder. 

I reworked my movement code to use a different ForceMode and activating Interpolation on the RB now takes care of the judder without needing to fiddle with the Time settings. Weird.

Anyway, I might still set the fixed update to 90Hz until I run into performance issues.