Can I stop SteamVR from reenabling XR support?

I need to quickly iterate on my game in the editor to test things, so I disable XR and watch it in scene view, but something (gotta be SteamVR from github) keeps reenabling XR support which forces WMR to start when hitting Play and it is slow every time. How can I avoid it?

Same here- what I did was unplug my WMR headset. It seems that the XR support checkbox will magically be selected after 30 minutes or so, ifthe HMD is plugged in. Hopefully it will be fixed in the future.

And disable the VR camera rig and turn the main back on.

BTW - this only happens with the Windows Mixed Realty headset, not my Vive. So I don’t think its steam.

Interesting. Well, I can’t unplug, it’s too hard to reach. Maybe there is another way to disable the headset… That still has to be SteamVR because I don’t imagine Unity assumes you are making a VR game just because you happened to have a WMR headset pugged in :slight_smile: Unless you don’t have steamVR installed and are still getting the same behavior.

I guess I can disable it in Device Manager.

I have the WMR Steam VR version installed. On another system, I just have regular steam VR. No problems on the regular steam VR version.

To get around it I just look a it every 5 minutes or so, when testing, and uncheck it when it automatically come on again. Because - I’m lazy too. I hate reaching around to the back of my computer to disconnect. But I love to flip up my Lenovo Explorer and make changes.

In the mean time, I think I will buy a HDMI extender and put it on top of my rig to facilitate my laziness - lol

BTW - I think windows almost got a lot of things right with their MR. Except the name, and putting me in that stupid house at startup, and hiding the adjustments for the floor settings, and thinking I want to talk to catana to use VR, and I have no IPA adjustment…

Let me know if you find a place to post to ask for a fix and I’ll join you.

My fix will probably end up being an HDMI extension as well :slight_smile:

I found two quick solutions.

  1. Comment out everything inside AutoEnableVR()

Use this to quickly toggle:

#if UNITY_EDITOR // Or put in the Editor folder
public class XRMenu
{
    [MenuItem("XR/Enable")]
    static void Enable()
    {
        PlayerSettings.SetVirtualRealitySupported(BuildTargetGroup.Standalone, true);
        Debug.Log("XR suppport enabled.");
    }

    [MenuItem("XR/Disable")]
    static void Disable()
    {
        PlayerSettings.SetVirtualRealitySupported(BuildTargetGroup.Standalone, false);
        Debug.Log("XR suppport disabled.");
    }
}
#endif
  1. And before I found that, I made this script:
#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;

[ExecuteInEditMode]
public class ShutUpXR : MonoBehaviour
{
    public bool EnableVR;

    protected void Update()
    {
        PlayerSettings.SetVirtualRealitySupported(BuildTargetGroup.Standalone, EnableVR);
    }
}
#endif

Use it if for some reason you can’t find where it gets enabled.

Use “PlayerSettings.virtualRealitySupported = false;” instead if need to disable on all platforms.

1 Like

I made a slight modification to @illinar for it to work with SteamVR plugin.

using UnityEditor;
using UnityEngine;

#if UNITY_EDITOR // Or put in the Editor folder

public class XRMenu
{
    [MenuItem("XR/Enable")]
    private static void Enable()
    {
        Valve.VR.SteamVR_Settings.instance.autoEnableVR = false;
        PlayerSettings.SetVirtualRealitySupported(BuildTargetGroup.Standalone, true);
        PlayerSettings.virtualRealitySupported = true;
        Debug.Log("<color=green>XR suppport enabled.</color>");
    }

    [MenuItem("XR/Disable")]
    private static void Disable()
    {
        Valve.VR.SteamVR_Settings.instance.autoEnableVR = true;
        PlayerSettings.SetVirtualRealitySupported(BuildTargetGroup.Standalone, false);
        PlayerSettings.virtualRealitySupported = false;

        Debug.Log("<color=yellow>XR suppport disabled.</color>");
    }
}

#endif
Valve.VR.SteamVR_Settings.instance.autoEnableVR = true;

You can do this manually and leave auto enable off by going to Assets/SteamVR/Resources/Settings (ScriptableObject) and turning it off there.