diy mobile vr with unity 3d & cardboard sdk
TRANSCRIPT
DIY Mobile VR with Unity & Cardboard SDK
Dr James BirtAssistant Professor of Interactive Media and Design (Games & Multimedia)• BIT (Hons), PhD (Software Engineering &
Artificial Intelligence)• 2014 Australian Office for Learning and
Teaching Citation for Outstanding Contribution to Student Learning
• 15+ years industry & academic experience• https://bond.edu.au/profile/dr-james-birt
Setup - What do you need?
Unity 5 - https://unity3d.com/ Google Cardboard SDK for Unity - https://developers.google.com/cardboard/unity/download
Hardware:- Android Phone – E.g. Samsung S6 - Head Mounted Cardboard – E.g.
ColorCross - Bluetooth Controller – E.g. PlayStation 4
First Person Character Controller - https://dl.dropboxusercontent.com/u/9011716/Character%20Controllers.zip
Create New Project
Create the project in your own folder location
1
2
• Download First Person Character Controller from - https://dl.dropboxusercontent.com/u/9011716/Character%20Controllers.zip
• Unzip the controller into your Assets Folder as shown
Add Character Controller
Add Cardboard SDK1
2
https://developers.google.com/cardboard/unity/download
Create a Test Scene
Be mindful of your Frame Rates try to reduce your lighting overheads
Build Cardboard Controller (Part1)
1. Add FPSController Prefab to your Hierarchy
2. Set the FPSController object Transform to align with your scene
Build Cardboard Controller (Part2)
1. Add CardboardMain Prefab to you Hierarchy and child to your FPSController
2. Set the CardboardMain object Transform to the same values as the FPSController Camera
3. Remove the Main Camera from the FPSController & Hierarchy
Build Cardboard Controller (Part3)
1. Move the Cardboard Head (Script) From Head to First Person Controller
2. Turn off Track Position
3. Set Update Early
These steps will allow you to move in the direction your character controller is facing
Connect Your PS4 Controller1. On controller hold down Share & PS buttons until light bar flashes
white
2. On Android device, enable Bluetooth, then select the “Wireless Controller” option listed. Once connected you will notice you can use the controller to navigate your device
Set Build Settings for Android
1
2
3 4
5
Add your app details settings I have left as
default
Remap Controller Buttons
• Please note: Different android devices will map the PlayStation buttons differently
• You will need to experiment with the button controls and actions
• This list is for PC only
Build to Your Android Device
1
For details on how to setup your Android phone:http://www.slideshare.net/jamesbirt35/visualisation-interactive-prototyping-with-unity3d
2
Demo Scene
To make your lighting dynamic try adding the following JavaScript code to your directional light & set your speed variable e.g. 5