Forum Discussion
brendenfrank
12 years agoHonored Guest
Get current OVR camera rotation
Hey guys,
I'm trying to get the current facing rotation of the OVRCamera and it appears to be eluding me.
The OVRCameraController appears to store no information and the rotation appears to be handled individually on CameraLeft and CameraRight.
I have tried manually pulling the rotation from one of the two cameras and always appears to be off. So my question is:
How would one get the facing rotation of the OVRCameraController in real time?
Thanks!
I'm trying to get the current facing rotation of the OVRCamera and it appears to be eluding me.
The OVRCameraController appears to store no information and the rotation appears to be handled individually on CameraLeft and CameraRight.
I have tried manually pulling the rotation from one of the two cameras and always appears to be off. So my question is:
How would one get the facing rotation of the OVRCameraController in real time?
Thanks!
3 Replies
Replies have been turned off for this discussion
- KrisperExplorerThe right camera rotation should return the correct rotation although I had trouble doing it too. I wanted to put a crosshair in the direction I look. I ended up putting an empty object as a child of the right camera with some z offset and cast a ray from the camera to its child. Obviously not the right way to do it, but using camera.forward wasn't working for me.
- KrisperExplorerJust read where the Proton Pulse guy did a similar thing https://developer.oculusvr.com/forums/viewtopic.php?f=30&t=3296 except he put the child object into the left camera.
- brendenfrankHonored GuestSo just to update you guys, I think I found a fairly simple solution:
The 'Tracker Rotates Y' checkbox will update the rotation of the OVRCameraController Gameobject so all you need to do is grab its rotation. -That said, this is only if you want the Y, which I do.
The 'gotcha' with this is that it doesn't work properly if it's a child of another game object. So if you have a character controller, you can't just make it the child of that object and will need to have them both in root while updating the position of the OVR camera to match your character controller position.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 9 years agoAnonymous
- 8 months ago