![]()
Note: Usually, the object is created automatically after using some prefabs from the Cardboard SDK package, so use this one instead of creating a new one.Īdd the GazeInputModule script to the EvenSystems object. ![]() This object will have the GazeInputModule, which allows the user to select elements by looking at them. For this example, we'll interact with the Unity Chan character and change her animation every time we look at her.Ĭreate an EventSystem object. ![]() You can add a target behavior to your application to be able to select target objects when you're looking at them. Once this is done, your application is able to trigger events from the Cardboard device, so every time you pull the button, the camera will move in the direction your looking at, like walking in that direction. Public class CardboardBehaviour : MonoBehaviour Use the event to trigger the action desired every time the button is pulled. Set the behavior for the button in the Cardboard device. For this example, we'll use the button in the Cardboard device to walk in the direction that the device is gazing at.Ĭreate a new script: This script will have the behavior from Cardboard device.Ĭreate an empty object and add the created script: Now you're ready to add a trigger event and be able to execute an action every time the magnetic button is used in the cardboard. You will be able to look around the scene. Once this is done, your application is ready to support VR and can be deployed on your device. You can delete the Main Camera that was created by default and replace it with this.Īdjust the position of the camera to the appropriate height. #Google vr android studio download fullThis prefab contains a full stereo rig, with a camera tagged MainCamera, and an instance of the Cardboard script for controlling VR Mode. Now you're ready to setup the camera for the Cardboard application.īasically, what we need is to change our project to enable VR support.Ĭreate a new camera with a CardboardMain prefab. The files will be created in the Cardboard folder in your project. Select the elements from the package (we omitted the iOS components because we don't need them): Select the downloaded Cardboard SDK CardboardSDKForUnity.unitypackage. Once your scene is ready, you can start the integration for the Google Cardboard SDK for Unity and import the Cardboard SDK package. Terrain: I've created the environment using a terrain object from the Nature Starter Kit.Ĭharacter: I've created a Unity Chan character object from the "Unity-chan!" Model. Main Camera: Default camera created by Unity. In this case I have the following elements in my scene:ĭirectional Light: Default light created by Unity. ![]() Google Cardboard device Create your project "Unity-chan!" Model: !/content/18705 Android Mobile Device #Google vr android studio download installThis will install the Android SDK, which we need to deploy application in an Android device.ĭownload the installer from: Java Development Kit (JDK)ĭownload the latest version from: Cardboard SDK for Unityĭownload the SDK Unity package from: Additional assets (Optional) Make sure to install the Android Build Support component during the installation. #Google vr android studio download downloadDownload the Unity download assistant from: This tutorial is a guide to create your first Google Cardboard application and deploy it on your phone. The Google Cardboard puts virtual reality on your smartphone. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |