Giter Site home page Giter Site logo

unity-gearvr-boilerplate's Introduction

Unity Gear VR boilerplate

This repository can be used as a starting point for building Samsung Gear VR apps in Unity 5.

If you are new to Gear VR development, chapter 4 in the book "Learning Virtual Reality" is highly recommended. It's currently available online here: https://www.safaribooksonline.com/library/view/learning-virtual-reality/9781491922828/ch04.html

Building the project

You will need to download and install a few things to be able to build this project.

Install required Unity version

To develop for Oculus 1.3 you'll NEED to specifically be using Unity 5.3.4p1: http://unity3d.com/unity/qa/patch-releases/5.3.4p1

Patch Unity's Oculus plugin

You will also NEED to download the OVRPlugin separately and patch Unity: https://developer.oculus.com/downloads/game-engines/1.3.0/OVRPlugin_for_Unity_5/

Unpack the downloaded file and replace Unity's oculus directory with the downloaded oculus directory.

On OSX, the oculus directory is located by default at /Applications/Unity/Unity.app/Contents/VR. on Windows, the oculus directory is located by default at C:\Program Files\Unity\Editor\Data\VR\oculus.

For more information, see https://developer.oculus.com/documentation/game-engines/latest/concepts/unity-ovrplugin-130/.

Install Android SDK

Download the Android SDK from: http://developer.android.com/sdk/index.html#Other

Unpack (OSX) or install (Windows) the downloaded SDK in a directory of your own choice.

In Unity, go to Unity -> Preferences and select the External Tools tab. Click the browse button for Android SDK and select the directory where you placed the Android SDK.

For more information, see:

Install Java Development Kit

Download the latest JDK here and install it: http://www.oracle.com/technetwork/java/javase/downloads/index.html

In Unity, go to Unity -> Preferences and select the External Tools tab. Verify that Android JDK is set to a path. If not, try building the project and Unity should autodetect the path. If not, the default path on OSX is /Library/Java/JavaVirtualMachines/jdk[version].jdk/Contents/Home/.

Testing on the phone

To be able to build and test directly from Unity on your Android phone - with and without Gear VR - you must do a few things.

Connect your Android phone to your computer via USB

Unlock the phone and connect to the computer via USB. Approve any prompts on the phone to trust the computer and grant it access.

In Windows 8 and 10, most Android phone will be immediately recognized when you connect it.

On OSX, you will need to install Android File Transfer to get the phone properly connected: https://www.android.com/filetransfer/

Make sure have enabled Development Mode on the phone following these steps: https://developer.oculus.com/documentation/mobilesdk/latest/concepts/mobile-android-debug/

Download an Oculus Signature File (osig) for your phone

In a terminal window, go to the directory where you installed the Android SDK. Change into the platform-tools directory and run this command (omit the prefixed ./ on Windows):

./adb devices

Go to https://developer.oculus.com/osig/ (make sure you are logged in with your Oculus Developer account) and paste the device id output from the command above into the input field.

Click the Download File button and save file in /Assets/Plugins/Android/assets/ relative to root of this boilerplate Unity project.

Enable VR developer mode

This is an optional step if you want to be able to view the application in stereo mode on the phone without inserting it into the Gear VR. Follow the steps here:

https://developer.oculus.com/documentation/mobilesdk/latest/concepts/mobile-troublesh-device-run-app-outside/

Build and run the project

Press Command/Ctrl + B or go to File -> Build & Run. Give the package any name and save it anywhere on your computer.

If all the steps above have been completed successfully, you should - once the build and publishing process in Unity completes - be prompted to insert your phone into the Gear VR and see the scene.

If you have enabled VR developer mode, the app should launch directly - however, you will not be able to look or move around as this relies on senors and the touchpad in the Gear VR.

After this, you will now have an app on your phone called unity-gearvr-boilerplate that you can start manually, and which Unity will update whenever you Build & Run the project with the phone connected via USB.

Download summary

unity-gearvr-boilerplate's People

Contributors

rspace avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.