cancel
Showing results for 
Search instead for 
Did you mean: 

Rotate camera within OVRCameraRig

Anonymous
Not applicable
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);

}
0 REPLIES 0