cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Step by step guide to Unity integration?

nypraise
Level 3
I am pretty new to Unity and the Oculus SDK did not tell me much. Are there someone who could make a step by step guide how to integrate the Oculus SDK to Unity? ๐Ÿ™‚
25 REPLIES 25

wccrawford
Level 2
Drag the OVR camera controller prefab onto your existing FPS player. Position it at the head. Link the part of your player that rotates to the OVR camera controller's script where it says something like 'follow orientation'.

Congrats, you've made a game for the Rift!

Okay, getting your menus to work and such is going to take a bit longer, but that's the basics and should have you playing around in no time.

nypraise
Level 3
And that is in /LibOVR/Src/? What is the filename? Canยดt seem to find a Camera controller there. :?

cybereality
Level 16
1) Open Unity and create a new project and a new scene (or open the project you wish to add Rift support to).
2) From the top menu, under "Assets" choose "Import Package" -> "Custom Package"
3) Find the 'OculusUnityIntegration' folder you should have extracted from the 'ovr_unity_0.2.1_lib.zip' download file.
4) Click on the 'OculusUnityIntegration.unitypackage' and click 'Open'.
5) In the Project menu click the down arrows next to 'Assets' then 'OVR' then click "Prefabs'.
6) In the window drag the 'OVRPlayerController' into the Scene view.
7) If this is a new scene you may want to create a floor first and add some objects so you can see whats going on.
๐Ÿ˜Ž Reposition the 'OVRPlayerController' into a good place in the scene, above the floor and not colliding with anything.
9) Drag the 'Game' window onto the Rift screen (if in extended desktop mode) and click the small square next to the 'x' on the top-right.
10) Click 'Play'.
11) Have fun!
AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV

nypraise
Level 3
@cyberreality Now thatยดs a step by step guide! Thanks a million! ๐Ÿ™‚

ftarnogol
Level 2
Is IPD a variable which value can be adjusted in the Unity OVRController?

Breymac
Level 2
Thank you cyber! now is there a way to be able to choose at the start if the game will have the oculus enabled or not?
also, how can i get the skybox to be black, when i change the camera from blue to black, it automatically reverts it.

AdamsImmersive
Level 2
"Breymac" wrote:
Thank you cyber! now is there a way to be able to choose at the start if the game will have the oculus enabled or not?
also, how can i get the skybox to be black, when i change the camera from blue to black, it automatically reverts it.


Try this: in the OVRCameraController script, add...

[SerializeField]

...on a line by itself before the two lines that set the background color. (Search for "background" and you'll find the spot.)

Otherwise, the color you set in the Unity GUI inspector keeps getting overridden. (Not sure if this is a bug or intentional.)

The same is theoretically true of other settings, though I've had mixed results.
โ€” Morgan โ€” Mac OS X โ† Unity

Breymac
Level 2
Hm, didnt seem to work, got overwritten, but when i was mid-game and switched it, it stayed.

hotshotz79
Level 2
Followed the steps listed above, seems to work except the crosshair.

I tried draggin and dropping the 'OVRCrosshair' script onto the OVRPlayerController and got the following error
"Can't add script behaviour OVRCrosshair. The script needs to derive from MonoBehaviour!"

So I edited the script and changed
public class OVRCrosshair

to

public class OVRCrosshair : MonoBehaviour


Now I am able to drag and drop to the Player Controller, then updated the null objects with the prefabs in my current scene, but nothing shown.

Question: How do I make the crosshair to show/work?