Setup guide

Unity | Migrating From Earlier Versions | 37
1. Ensure you didn’t modify the structure of the OVRCameraController prefab. If your eye cameras are on
GameObjects named “CameraLeft” and “CameraRight” which are children of the OVRCameraController
GameObject (the default), then the prefab should cleanly upgrade to OVRCameraRig and continue to work
properly with the new integration.
2. Write down or take a screenshot of your settings from the inspectors for OVRCameraController,
OVRPlayerController, and OVRDevice. You will have to re-apply them later.
3. Remove the old integration by deleting the following from your project:
OVR folder
OVR Internal folder (if applicable)
Moonlight folder (if applicable)
Any file in the Plugins folder with “Oculus” or “OVR” in the name
Android-specific assets in the Plugins/Android folder, including: vrlib.jar, libOculusPlugin.so, res/raw and
res/values folders
4. Import the new integration.
5. Click Assets -> Import Package -> Custom Package…
6. Open OculusUnityIntegration.unitypackage
7. Click Import All.
8. Fix any compiler errors in your scripts. Refer to the API changes described above. Note that the substitution
of prefabs does not take place until after all script compile errors have been fixed.
9. Re-apply your previous settings to OVRCameraRig, OVRPlayerController, and OVRManager. Note that the
runtime camera positions have been adjusted to better match the camera positions set in the Unity editor. If
this is undesired, you can get back to the previous positions by adding a small offset to your camera:
a.
Adjust the camera's y-position.
a. If you previously used an OVRCameraController without an OVRPlayerController, add 0.15 to the
camera y-position.
b. If you previously used an OVRPlayerController with Use Player Eye Height checked on its
OVRCameraContoller, then you have two options. You may either (1) rely on the new default player
eye-height (which has changed from 1.85 to 1.675); or (2) uncheck Use Profile Data on the converted
OVRPlayerController and then manually set the height of the OVRCameraRig to 1.85 by setting its y-
position. Note that if you decide to go with (1), then this height should be expected to change when
profile customization is added with a later release.
c. If you previously used an OVRPlayerController with Use Player Eye Height unchecked on its
OVRCameraContoller, then be sure uncheck Use Profile Data on your converted OVRPlayerController.
Then, add 0.15 to the y-position of the converted OVRCameraController.
b.
Adjust the camera's x/z-position. If you previously used an OVRCameraController without an
OVRPlayerController, add 0.09 to the camera z-position relative to its y rotation (i.e. +0.09 to z if it has
0 y-rotation, -0.09 to z if it has 180 y-rotation, +0.09 to x if it has 90 y-rotation, -0.09 to x if it has 270 y-
rotation). If you previously used an OVRPlayerController, no action is needed.
10.Re-start Unity
Common Script Conversions
Deprecated Use Instead
OVRCameraController OVRCameraRig
cameraController.GetCameraPosition() cameraRig.rightEyeAnchor.position
cameraController.GetCameraOrientation() cameraRig.rightEyeAnchor.rotation
cameraController.NearClipPlane cameraRig.rightEyeCamera.nearClipPlane