Search Unity

XR Disabled, Gear VR still intercepts launch

Discussion in 'AR/VR (XR) Discussion' started by KingKRoecks, Jul 6, 2018.

  1. KingKRoecks

    KingKRoecks

    Joined:
    Jul 28, 2013
    Posts:
    155
    Hey hey!
    I've been working on a mobile game recently and played around with the idea of using a VR camera rig.
    And now, I've turned off the VR Supported setting (And also added "None" to the list and floated it top).

    Now I'm trying to disable it and use just a normal camera setup, but my phone with the Gear VR software installed keeps launching Gear VR whenever the app launches.
    I've been at this for the last 24 hours and haven't had any luck.

    Does anyone know what's causing Gear VR to intercept this app? I read on one of the Oculus wikis that some VR information is automatically injected into the Android manifest. Anyone know how to suppress this without fully uninstalling the VR plugins?
     
  2. alexchesser

    alexchesser

    Joined:
    Sep 15, 2017
    Posts:
    147
    I have got a gameobject in my in my root scene controller where the Awake method has a line that turns off by calling the code

    Code (CSharp):
    1. UnityEngine.XR.XRSettings.enabled = false;
    https://docs.unity3d.com/ScriptReference/XR.XRSettings-enabled.html

    now you still start in two-camera mode for the splash screen, but then snap back to non-VR as soon as the first scene launches. From there you can actually call the same function with a TRUE flag from anywhere to dynamically re-enable VR.

    I don't know if that helps for you.
     
  3. KingKRoecks

    KingKRoecks

    Joined:
    Jul 28, 2013
    Posts:
    155
    I'll try it out soon. For the meantime I just deleted all of the VR stuff out of the project and that seems to prevent the manifest adding VR to it.

    The problem isn't that there's a dual-image rendering for VR stuff, it's more that the GearVR launcher is intercepting the app saying "Please put device in headset" before it will launch the game. When the game is running standard 3d with a screenspace UI and not VR, that's going to be a problem if anyone owned a GearVR and had the software installed.
     
  4. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    You can't just disable Oculus for VR. Even if disabled, having the SDK in your device list still causes the build system to include the Oculus SDK in the build. When this is included, an entry in the AndroidManifest.XML is added that declares the app as requiring Gear VR support. The only way around this currently is to make a build of your app specifically for Gear VR and a separate build for everything else.

    This is an OS level issue with Gear VR and not something that Unity can get around. This is a known issue that Oculus is working on but at this time I have no information on when that fix will be in and distributed.
     
  5. GearVR

    GearVR

    Joined:
    Nov 13, 2015
    Posts:
    16
    Hi there KingKRoecks

    Can you PM me a sample application. I'm with Samsung's game developer support and relation team and can look into any VR-related issues.

    Thanks
     
  6. Kyodan

    Kyodan

    Joined:
    Feb 5, 2015
    Posts:
    8
    I believe if OVRManager is anywhere within your scene, it will attempt to force VR support on.