Guide to migrate a GVR project to Cardboard.

This guide shows you how to migrate Unity projects from the deprecated Google VR (GVR) to use the Cardboard XR Plugin.

Set up your development environment

Software Requirements:

  • Unity 2021.3.32f1 or later supported by the Cardboard XR Plugin.
    • Make sure to include Android and iOS Build Support during installation.

Open your GVR project and export the scene without the GVR package.

Follow these steps to open your existing GVR project and export the scene.

  1. Open your Unity project using GVR.

  2. In Unity, go to Assets > Export package to export the current project.

    Alt text

  3. Unselect all folders containing scripts to avoid compiling errors when importing the project on a newer version of Unity, as it does not support GVR.

    Alt text

Create a new project on a newer version of Unity and import your project.

  1. Open a newer version of Unity supported by Cardboard XR Plugin (Unity 2021.3.32f1 or later) and create a new 3D project.
  2. Import the GVR project.

    Alt text

Import the Cardboard SDK.

  1. Import the Cardboard SDK following the Quickstart for Google Cardboard for Unity.

Adjust the scene settings to be supported by Cardboard.

  1. Add the ObjectController script to all interactive objects in the scene.

    1. On the Hierarchy panel navigate to Treasure and select the Icosahedron shape

      Alt text

    2. On the Inspector panel on the left, in the Script component, select the ObjectController script.

      Alt text

    3. Repeat the process on all three shapes.

  2. Drag the script CardboardReticlePointer.cs to Player > Main Camera > GVRReticlePointer.

    The script is located at Packages/com.google.xr.cardboard/Runtime/CardboardReticlePointer.cs.

    Alt text

  3. Drag the script CardboardStartup.cs to the CubeRoom.

    The script is located at Assets/Samples/Google Cardboard XR Plugin for Unity/<version>/ Hello Cardboard/Scripts/CardboardStartup.cs.

    Alt text

  4. Select Player > Main Camera and, in the Inspector panel, add the component Tracked Pose Driver.

    Alt text

Configure and build your project.

  1. Follow the configuration guide provided in the Quickstart for Google Cardboard for Unity for your respective device.