As far as I can tell, the intended work around is to add the
CharacterCameraConstraint script to your OVRPlayerController.
This provides you with the option to 'Enable Collision' but as the tooltip says "When true, the camera will be prevented from passing through collidable geometry. This is usually considered uncomfortable for users." Try it and you'll see that you get pushed back if you try to physically walkthrough geometry. It's a pretty odd sensation but it does keep CharacterController and the OVRCameraRig in sync.
A possibly better option is to use 'Enable Fadeout', which instead fades the camera view to black when you start to physically walk through geometry. This tends to have the effect of stopping the player in their tracks, which minimises the likelihood of CharacterController and the OVRCameraRig getting offset, but of course doesn't guarantee it.
If you go for the Fadeout option, it's worth knowing that in Oculus Utilities v1.43.0, OVRPlugin v1.43.0, SDK v1.44.0 the lines of code that are activated by `
if(EnableFadeout){
`... are actually commented out and so this option no longer does anything. it appears to be because the
OVRInspector.instance.fader
instance no longer exists in the newer codebase.
To get around that, you can add a copy of OVRScreenFade on the OVRPlayerController gameObject and reference that instead.
So in CharacterCameraConstraint.cs:
//if (EnableFadeout)
//{
//float fadeLevel = Mathf.Clamp01((CurrentDistance - FadeMinDistance)/ (FadeMaxDistance - FadeMinDistance));
//OVRInspector.instance.fader.SetFadeLevel(fadeLevel * MaxFade);
//}
becomes
if (EnableFadeout)
{
float fadeLevel = Mathf.Clamp01((CurrentDistance - FadeMinDistance)/ (FadeMaxDistance - FadeMinDistance));
OVRScreenFade _screenFadeScript = GetComponent<OVRScreenFade>()
if(_screenFadeScript != null) _screenFadeScript.SetFadeLevel(fadeLevel * MaxFade);
}
Of course you're better off caching the reference to the OVRScreenFade component (or even adding one dynamically in Start() `if(EnableFadeout)
`
Also it's worth bearing in mind that the mesh quad that OVRScreenFade creates to blackout the player's view isn't ideal for this application - you can see its extents if you gaze up or down. I've ended up creating a cube mesh (with inverted normals) so that the entire view goes black.