HI All,
Been trying for a few days to make oculus headset to turn toward an object. Tried, lookat and toward, each with different syntax/override, also tried with eulerangles (difference of two points) nothing works.
I have a table, I want the cam to look at table when spawning. It spawn at right place and height, but it stays in the direction where I was looking at when I pushed start.
Last try, code is executed when player wear HMD:
Vector3 location = new Vector3(0.0f, 0.0f, 0.0f);
location = Cam_desired_pos_rot.transform.position;//wanted position
xrorigin.transform.position = location;//position xrorigin and cam, works OK
//rotate origine-cam toward table
location = mytable.transform.position;//get table location that we want to look at
My_Camera.transform.LookAt(new Vector3(location.x, My_Camera.transform.position.y, location.z));
Camera is child of xrorigin\offset. Tried to rotate xrorigin also.
Must I turn off HMD controller ?
NOTE: I read correct position and rotation of both xrorigin-cam and table.
Pretty sure I miss something obvious here…
TIA for any help, reference or suggestion.
Regards,
Robert