I am making a hover race game in VR, however I am having an issue. I found this set of videos from Unity about a hover racer and used it. It adds a force to the RigidBody to turn and to move. I get the value of this, however the thing is when the vehicle turns there is a bit of stuttering to the view.
When I am just standing there and move my head back and forth, there is no stutter. It’s when the rotation code, seen below, runs that I get this annoying stutter. This only occurs in VR. I created a testbed scene with a new camera and only this code (as well as the necessary components to show the scene in VR) to insure that it’s not some other influence.
So, before I started trying other turning mechanisms I thought I should ask if there is a standard for movement in VR. Since these are cars obviously I cannot use teleportation, I need continuous moment. Thoughts?
Tried this in Update, FixedUpdate and LateUpdate. Issue persists in all.
This happens on all version in the 2019 series as well as the current release of 2020
Thanks, but the ONLY code for turning the camera parent is stated above. That code is in the FixedUpdate of the parent ; “XR Rig Follow” See this image for details on the XR rig: https://imgur.com/a/XLfBMiB
I made this simple scene to minimize outsize influence. So… what am I missing?
Thanks kindly for taking the time. Have a great week
you need to set the physics timing of your project to match the VR headset screen frequency or exceed it, since the fixed update is not tied to framerate but to a fixed time lapse.
try with 0.012 in the Time setting on the project properties.
to fine tune it, use this formula:
Fixed Time Step = 1 / headset frequency
For the Quest, it’s 72hz
for the oculus Rift S, it’s 90hz
For every headset it can be different.
You can check the screen vertical frequency using this.
Also, you can set the fixed time step by script using Time.fixedDeltaTime = 1f/frequency
Camera tracking code should be done in LateUpdate.
Physics run at different framerate and that framerate cane be LOWER than screen refresh rate.
By default, by the way, it is running at 50 fps, and compared to 90, 80 or 75Hz refresh rate of VR, yeah, it is going to stutter. So either don’t use physics code for camera, or configure physics framerate to match that of your headset.
Ah, ok. I think I get your point. This is an odd situation when dealing with racing games. I will have to think about the entire process. Thank you for the info