Rotate camera within OVRCameraRig — Oculus
Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

Rotate camera within OVRCameraRig

DomBeyDomBey Posts: 1
NerveGear
edited June 9 in Unity Development
Hi,

so what I am trying to do, is to change the OVRCameraRig's position and rotate the CenterEyeAnchor afterwards, so it is facing the point it was looking at before the position change.
This worked for a normal camera but somehow it doesn't work for the CenterEyeAnchor. Is there any way to rotate the camera to the disired point?

RaycastHit hit;
var ray = centerEyeAnchor.ScreenPointToRay(new Vector3(Screen.width / 2, Screen.height / 2, 0));
if (Physics.Raycast(ray, out hit))
{
var point = hit.point;
transform.position = Position;
centerEyeAnchor.transform.LookAt(point);
}
Sign In or Register to comment.