I’m just getting into Oculus Go development, following this guide to add a controller-linked laser pointer to the targeting reticle in the VR Samples app.
It mostly works, except that when I turn my head, the targeting reticle and the laser pointer get out of sync. It appears that the reticle moves a little faster across the world than my laser. When I stop moving, then they sync back up again.
EDIT: It happens even if I hold the controller perfectly still, and just turn my head back and forth. In this case the laser appears perfectly steady on the world, while the reticle waves back and forth. But I’ve gone over the code, and I can’t see why — we set the reticle position directly from the same hit point as the line renderer, and at the same time.
Has anybody else noticed this flaw? Anybody happen to know the correct fix?
I been running some test on the Oculus Go and everything works perfect. Haven’t seen any of that. I am using Unity 2017.3.1p4
That said, when the project starts and you see the unity logo… if you move your head… I see the same effect. A delay to catch up. I believe is purposely done.
Agreed about the logo. I’ve seen logos in commercial games (mostly out of WB) doing the same thing.
So strange that you’re not seeing this effect in yours though. Did you work from the same tutorial?
My current theory (which I haven’t had a chance to go in and test) is: the reticle is parented under the camera, but the laser pointer is not. And the camera gets moved (of course) when you move your head. And I think that’s happening after we set the reticle position (perhaps in LateUpdate or something), so while your head is moving, it’s always a bit wrong.
The fix, perhaps, would be to move the whole pointer-updating thing into LateUpdate. Or maybe I can take the reticle out from under the camera.
I’m about to start in on my own code, though; there’s a lot of neat stuff in VR Samples, but a lot of stuff that just don’t fit with the way I roll (like the pervasive use of Action instead of UnityEvent). At least when I develop it myself, I’ll understand how it works!
The HMD update from the sdk Unity has said actually happens after lateUpdate so moving the code there isn’t going to help. I haven’t run this particular case but have seen one frame out of sync stuff before. Is most noticeable when there is fast movement. Because of when that occurs there isn’t much you can do but put it in the hierarchy under the camera and change the code to be based on local position instead.
This only pertains to stuff related to low level native sdks. HMD for sure and probably controllers as well, but Unity hasn’t confirmed that part.
No, what I want is the opposite — I’ve already placed the reticle at the correct place in the world; I need the SDK to not screw it up. So moving it out from under the camera ought to do it.
By this point I’ve moved onto my own code, which works that way (the reticle is not under the camera), and it’s working fine. I haven’t gone back and tried to fix the VR Samples scenes, but I’m pretty sure it would work there too (though the code might need some adjustment).