Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
fashVR's avatar
fashVR
Honored Guest
3 years ago
Solved

VR in Unity makes physics jitter/stutter

I'm currently developing a VR game in Unity and have come across a perplexing issue. I've set up a ragdoll using rigidbodies and colliders. Here's what I'm facing:

  1. Without VR Headset: When I run the game without wearing the VR headset, the ragdoll and everything in the scene operates smoothly without any issues.
  2. With VR Headset: As soon as I put on the VR headset and run the game, I experience significant lag with the ragdoll. Interestingly, everything else in the scene remains unaffected and runs smoothly. It's worth noting that the ragdoll is the sole object in the scene governed by physics.

I'm wondering if this could be related to changes in physics refresh rates when using VR in Unity, but I'm not entirely sure. I would greatly appreciate any insights or guidance on this issue.

  • Try changing your FixedTimestep in the Time Settings. (https://docs.unity3d.com/Manual/class-TimeManager.html)

    It defaults to 0.02 which means your physics calculations are running at 1/0.02 = 50fps.

    Once you're in VR the headset locks the frame rate (a bit like VSync does) and will force 72Hz (72fps) or 90Hz (90fps) or higher. So change the Fixed Timestep to 1/90 = 0.11111 and you should get smoother physics

3 Replies

Replies have been turned off for this discussion
  • Try changing your FixedTimestep in the Time Settings. (https://docs.unity3d.com/Manual/class-TimeManager.html)

    It defaults to 0.02 which means your physics calculations are running at 1/0.02 = 50fps.

    Once you're in VR the headset locks the frame rate (a bit like VSync does) and will force 72Hz (72fps) or 90Hz (90fps) or higher. So change the Fixed Timestep to 1/90 = 0.11111 and you should get smoother physics

    • fashVR's avatar
      fashVR
      Honored Guest

      Tnx. it helped solve it, but most of it was that for some reason being in the scene view when the game runs made all physics jitter, weird

      • Yeah, don't underestimate editor overhead 😁 if you have a lot of gizmos or a complex inspector window (like a node based graph or animator state machine) then it's best to do full screen scene preview in run mode, just so you're only rendering the main view. Obviously best of all is to check performance on the device itself (if you're developing for standalone VR).

        Glad you got it sorted.