Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Anonymous's avatar
Anonymous
6 years ago

Rotate camera within OVRCameraRig

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);

}
Replies have been turned off for this discussion