Forum Discussion
nypraise
13 years agoExplorer
Step by step guide to Unity integration?
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
Replies have been turned off for this discussion
- wccrawfordHonored GuestDrag 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. - nypraiseExplorerAnd that is in /LibOVR/Src/? What is the filename? Can´t seem to find a Camera controller there. :?
- cyberealityGrand Champion1) 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.
8) 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! - nypraiseExplorer@cyberreality Now that´s a step by step guide! Thanks a million! :)
- ftarnogolExpert ProtegeIs IPD a variable which value can be adjusted in the Unity OVRController?
- BreymacHonored GuestThank 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. - AdamsImmersiveHonored Guest
"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. - BreymacHonored GuestHm, didnt seem to work, got overwritten, but when i was mid-game and switched it, it stayed.
- hotshotz79Honored GuestFollowed 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 changedpublic class OVRCrosshair
topublic 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? - cyberealityGrand ChampionYou can press "C" to make the crosshair appear. You don't have to edit the scripts.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 6 years ago