Disable cardboard rotational tracking

Is there a way in XR classes to set rotational value to some other quaternion than your phones rotation? I only see disable positional tracking and not rotational tracking in XR classes. I have found solutions prior to the XR addition to unity to solve this -

https://stackoverflow.com/questions/37316309/stop-disable-or-pause-head-tracking-google-cardboard

Am I missing something here, or has this become untenable in Unity for now?

Hello,
It’s a little hidden, but try this out: XRDevice.DisableAutoXRCameraTracking
Pass in the camera you’d like to disable and it should disable the automatic camera tracking entirely for you and let you manage the movement yourself.

If you’d like to replicate what we do under the hood, you can use Monobehaviour.Update and the Application.OnBeforeRender callback to set the camera to the XRNodeState tagged as a Center Eye. Use InputTracking.GetNodeStates to get the entire set of node states and read back the position.

Ping back if that works for you, or if you need more help.

2 Likes

This is perfect. Thank you so much!!

1 Like

StayTalm_Unity Hi. Thanks this above comment was a hint for me.
Please can you explain with code to perform “you can use Monobehaviour.Update and the Application.OnBeforeRender callback to set the camera to the XRNodeState tagged as a Center Eye”.
Thanks.