Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
GEMISIS's avatar
GEMISIS
Adventurer
11 years ago

Unity and Gear VR

Hi everyone,
So recently I've been going through and working on my first Gear VR application, and I've been struggling a bit to find solid documentation on how to use Unity with it. I've been reading that there are 2 ways of developing with Unity currently: native Unity integration via their recent built-in VR options, and the OVR Unity Integration Tools.

I followed the instructions for the Integration Tools, and while I was able to get my application to work, I have been unable to get a variety of needed things working. Specifically, the following have not worked for me:

    The Volume Keys
    The Back Button
    The Universal Menu


When I've dug around the code and begun debugging it, I've noticed that the isHmdPresent in OVRManager.cs is always false for my Gear VR. Yet the Gear VR is prompted for when I try to launch the app (The "To open this application, insert your device into your Gear VR" message appears perfectly fine, and goes away and launches my app when I insert my phone into it). My assumption as a result is that because I am using 5.2.2p2, I need to have native integration, but that leaves me with questions such as how to retrieve the volume, and how to implement the universal menu.

To summarize, I am just trying to figure out if I need to just use only native Unity tools and create a custom universal menu and volume control, or if I am just using the OVR Unity Integration Tools wrong. Any help would be much appreciated. Thanks!

Edit
Not entirely sure what happened, but overnight volume controls randomly appeared, and the back button I managed to get working by mapping to the Escape key (Universal Menu can hopefully just extend from that). I believe that this is due to an updated service on my Gear VR, but am not 100% sure.

5 Replies

Replies have been turned off for this discussion
  • Have you checked the Oculus Unity Utilities already to see if it has what you need?
  • The Legacy Integration is to be used without Unity's built-in VR support. Oculus Utilities works together with Unity's built-in VR support, and is the thing you want. Import the package, enable "VR supported" in Unity's Player settings, and drag in the OVRCameraRig prefab for your camera, basically. Full info in the docs. Recommended Unity version is 5.2.2p2.
  • I have tried both of these solutions, but neither has allowed me to use the volume keys.

    After playing around, I found that I was able to get the back button to work, but I had to use Unity's Escape key binding check in order to get it to register. Any other ideas? From what I am seeing, the SDK is not setup to work with the recommended Unity version :/

    Edit
    Strange, suddenly the volume started working in an app that I haven't re-deployed since yesterday. I guess the volume controls are now built into the service, and that must have updated at some point in the past 24 hours. All resolved I guess!
  • Update on this issue:

    In the Oculus documentation, this is what it says to do: "See HomeMenu.cs in the Unity SDKExamples project for usage example."

    Great, this is exactly what I need to look at...but:

    The example only works with legacy integration with Unity.
    What do I do? I've build my app with Unity 5.2.2 and Oculus Utilities.


    Do I have to install a legacy version of Unity on my other computer, just to open the package and look at the script for integrating the uMenu?? (Does this script even provide a valid example for Unity 5.2.2?)


    If it's just a matter of creating an empty game object and attaching a few lines of code for the 'back' button, please let me know! ;)