I’m having real difficulty migrating to the new XR system in 2021.
I’m only using the Quest 2 on Quest Link and only need the headset to work when the user enables it via UI. I only need the headset to work, so don’t need any controllers etc.
I have the XR Plugin and Oculus plugin installed with the latest versions.
Oculus is selected in Plug-in Providers under XR Plug-In Management
I have the Oculus software running and Quest Link selected.
Initialize XR on Startup is off.
This is the code I have attached to the UI button.
IEnumerator StartXR()
{
Debug.Log("Initializing XR...");
yield return XRGeneralSettings.Instance.Manager.InitializeLoader();
if (XRGeneralSettings.Instance.Manager.activeLoader == null)
{
Debug.LogError("Initializing XR Failed. Check Editor or Player log for details.");
}
else
{
Debug.Log("Starting XR...");
XRGeneralSettings.Instance.Manager.activeLoader.Start();
}
}
void StopXR()
{
Debug.Log("Stopping XR...");
if (XRGeneralSettings.Instance.Manager.activeLoader != null)
{
XRGeneralSettings.Instance.Manager.activeLoader.Stop();
Debug.Log("XR stopped completely.");
}
Camera.main.ResetAspect();
}
This works the first time I run it in the editor but after I always get this error message:
Failed to set DeveloperMode on Start.
It’s as though something isn’t being reset after exiting play mode.
Someone else asked on the forums but was never resolved:
Brilliant, thanks for that, this issue was driving me mad. Do you think this is a Unity problem, an Oculus problem or a problem with OpenXR? Thanks again mate.