AI-generated Key Takeaways
-
This guide provides step-by-step instructions for migrating Unity projects from the deprecated Google VR (GVR) to the Cardboard XR Plugin.
-
The migration process involves exporting your existing GVR project, creating a new Unity project with the Cardboard XR Plugin, and adapting the scene settings for Cardboard compatibility.
-
The guide uses the "HelloVR" demo game as an example to illustrate the migration steps.
-
You'll need Unity 2021.3.32f1 or later with Android and iOS Build Support to complete the migration.
-
For detailed configuration instructions and device-specific settings, refer to the Cardboard XR Plugin Quickstart guide linked within the document.
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.
Open your Unity project using GVR.
In Unity, go to Assets > Export package to export the current project.
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.
Create a new project on a newer version of Unity and import your project.
- Open a newer version of Unity supported by Cardboard XR Plugin (Unity 2021.3.32f1 or later) and create a new 3D project.
Import the GVR project.
Import the Cardboard SDK.
- Import the Cardboard SDK following the Quickstart for Google Cardboard for Unity.
Adjust the scene settings to be supported by Cardboard.
Add the ObjectController script to all interactive objects in the scene.
On the Hierarchy panel navigate to Treasure and select the Icosahedron shape
On the Inspector panel on the left, in the Script component, select the ObjectController script.
Repeat the process on all three shapes.
Drag the script CardboardReticlePointer.cs to Player > Main Camera > GVRReticlePointer.
The script is located at
Packages/com.google.xr.cardboard/Runtime/CardboardReticlePointer.cs
.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
.Select Player > Main Camera and, in the Inspector panel, add the component Tracked Pose Driver.
Configure and build your project.
- Follow the configuration guide provided in the Quickstart for Google Cardboard for Unity for your respective device.