Forum Discussion
NullReference
12 years agoHonored Guest
Forward vector?
How do you get the direction the player is currently looking as a vector? Like if you needed to raycast straight forward for instance. Normally I would use PlayerCamera.transform.forward but that is o...
sh0v0r
12 years agoProtege
"NullReference" wrote:
So the right camera is guaranteed to face directly forward from the center of the screen? Why is that?
Right Camera is on Layer 0, all orientation tracking is applied to this camera and the others use its transform information.
In OVRCamera:SetCameraOrientation()
// Main camera has a depth of 0, so it will be rendered first
if(gameObject.camera.depth == 0.0f)
The center doesn't matter because its an orientation vector, it doesn't matter where it is. If you want the centre of the eyes you will need to derive that some other way. I personally have an additional child object on the Right Camera that is offset in its local space to be in the centre. I do Raycasts from this objects Forward vector when I need to.
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
- 10 months ago
- 6 years ago
- 7 years ago