I was making a cool pointer for my VR application but it’s jittering when I move my head during the game.
Before this pointer I had a similar one made with an UI image attached to the HMD and I didn’t have any problem.
Now the new pointer is a mesh that i create and scale at run-time, I wonder if this could be causing issues?
Is there anything I am missing in regards to mesh generation and unity vr camera rendering that could be causing the issue? Any guesses and ideas are welcome
Big one with VR rendering is that we update the camera position 2x a frame: Once during Monobehaviour.Update(), and once during Application.onBeforeRender()
This second one is likely what’s causing the jitter. If you use Update, or LateUpdate, Unity is going to sneak in and move the camera right before rendering. That would explain why UI parented to the HMD works (it moves with the HMD and therefore gets that before render update), and a mesh in a separate part of the hierarchy does not. You’ll want to register for Application.onBeforeRender() and update your meshes position there.
In fact, if it’s purely cosmetic, you can likely drop the Monobehaviour.Update() update and rely entirely on before render.