Start a VR enabeled game without VR

How can i start a VR enabled game without using VR? There must be a console command to turn off VR.

I know there is a -vrmode to choose if you want either Oculus or OpenVR, but testing with off, none or null does not work.

This should be easy!

Google VR lets you develop without having the HMD connected.

All posts I can find about this subject talks about how you can develop a VR game without a HMD.
This is not my problem! I have a HMD connected, but I want to start the game.exe file as if I didn’t have a HMD.

Something like this:

C:\folder > game.exe -vr off

Game starts on my screen, the HMD is off an the camera only moves using mouse/keyboard/gamepad

I found a solution throug scripting. But there must be a “native” option for this…

void Awake ()
{
  string vr = getStartupParameter("-vr");
  if (vr != null && vr.Equals("off"))
  {
    VRSettings.enabled = false;
  }
}
private string getStartupParameter(string parameter)
{
  if(startupArgs == null)
    startupArgs = Environment.GetCommandLineArgs();
  string s = null;
  for(int i = 0; i < startupArgs.Length; i++)
  {
    if(startupArgs[i].Equals(parameter) && startupArgs.Length >= i+2)
      s = startupArgs[i+1];
  }
  return s;
}

The above solution does not work as expected… I turns off VR but the tie-in to the VR system is still there. I wanted to use this to be able to start one VR app and one non-VR app on the same computer, but that did not work. When starting the second app with the -vr off switch, the first VR app died…

I ended up just compiling two versions. One with VR support and one without…

I do agree there should be a switch in app to do this. So you can create a game playable with or without VR. I know people are going to ask why, but I do see an added value in this one. Especially when creating non-game apps that function like software. I used Unity once to load in 3d models to create quickly a walk trough. Now this VR turn off or on is very handy for this kind of situation.

If this was doable trough scripting, it would be very nice! VR enabled by default from build setting, on Awake you turn it off, so the app build has the tools to switch back again to VR.

the problem with some games is that they might have been made to only work as a vr gamewe need to know how the vr textures we see differ from the “normal” textures in non vr games so we know how they would need to be displayed, we would need to understand how vr headsets display the content,

you can switch xr sdks (and enable / disable device) on the fly by code. Take a look at XRSettings in the scripting API. I released ‘XR Switcher’ that does that.