Unity made it very easy to create VR apps, and with cardboard, it is just super easy.
Unity 5.1 onwards contains built-in support for certain VR devices, but for that, you require Unity pro licence.
So Why Cardboard ?
Because it is cheapest VR Device available in the market. it cost you only $10- $20, and you do not need Unity pro licence for that.
other options for virtual reality devices
all are very expensive and some are not easily available to the user. On the other hand google Cardboard works with most modern Android phones and iPhone. Phones need to be running Android 4.1 (Jelly Bean) or above. Ideally should have a gyroscope, most important there are tons of apps available.
- Unity – At least v5.1 is recommended. I’m using Unity v5.3 Personal edition.
- Windows or Mac – I’ll be using Mac in this tutorial.
- Cardboard SDK for Unity – That link will download zip file named “cardboard-unity-master”.
- Android SDK
- A Google Cardboard style headset.
- An Android device to put inside that headset.
- Basic knowledge of Unity.
enough theory, let’s jump to code now
First Download the latest Google Cardboard SDK for unity
Now follow these steps:
- Open Unity — image
- Create New Project
- Import the SDK package: Assets > Import Package > Custom Package. Select the CardboardSDKForUnity unitypackage where you downloaded it and click Open. and click import
- Now delete the Main Camera from the hierarchy and save your scene
- Now drag CardboardMain from prefabs folder to the hierarchy and save your scene
- Now drag CardboardReticle from Assets > Cardboard > Prefabs > UI to Cardboard > Head > Main Camera