Unity Gaming: Integrating Oculus

Setting Up

GREAT NEWS! In 2015 you no longer need Unity Pro Edition to integrate Oculus into your projects. YAY!

Things you’ll need for integration:

  • An Oculus (really you don’t need one to develop but how else will you test it out?)
  • Oculus SDK
  • Oculus Runtime
  • Unity 4 Integration

Okay so, the first thing you’ll need is to have your game all set up and running, in Unity. If you’ve been following my blog then you should have the bulk of the game running.

Cool. Next we need to grab the Oculus pieces from their site.

https://developer.oculus.com/downloads/

Now if you have a Mac or Linux download from those links.

WebsiteDownloads

 

After you download the links you now need to install the runtime. Then restart your computer.

Integrating into Unity

Extract the files from the Unity Integration Package you downloaded. Go Into Unity to Assets>Import Package> Custom Package

Find where you extracted the files and navigate to the Unity Plugin.

ImportingPackage2

 

Then hit import.

ImportingPackage3

Now you should have a new folder in your Assets called OVR

AssetsOVR

Cool so now it’s integrated lets Start using the Oculus Camera in the game.

Using Oculus Cameras

Now using the Oculus Package is super easy. Oculus has already created prefabs for developers to use. They have a prefab with just the camera rig as well as one with the rig and a character motor.

OVRPrefabs

To use them. Just do what you what you would normally do with prefabs. Click and Drag it into your scene.  I created a test scene called OVRTest to make sure everything would work without worrying about the infinite platforms generating around me.

I placed the OVRPlayerController at 0, 2, 0.

OVRinScene

Cool Now try running the game. You should have something that looks like this:

OVRGame

 

YAY! See super easy. The double circle screen is what will be fed to your Oculus, and with the lenses and the headset it should become one image with a 3 dimensional feel.

Now that you have the basic character installed you can add it to the main game scene and try it with the infinite platforms.

 

Happy Coding!

-TheNappingKat


Leave a Reply

Your email address will not be published. Required fields are marked *