- Home /
How to enable/disable VR from code?
How do I check/uncheck the "Virtual Reality Supported" setting from code? I've tried setting XR.XRSettings.enabled = true/false from a script executing in edit mode when the application is not running. It does not seem to do anything, and it definitely does not toggle that little box.
Have you found solution for it? At the moment I switch VR sdk priority by PlayerSettings.SetVirtualRealitySDKs(BuildTargetGroup.Standalone, sdks); where sdks is array of VR SDKS, if I want non VR startup I set first index of array to "None".
Thing is I got now a lot of warnings that I should not use PlayerSettings.SetVirtualRealitySDKs because it's obsolete. I haven't found any other way to do it tho.
Your answer
Follow this Question
Related Questions
Build Standalone (.exe) with google cardboard VR. 1 Answer
Setting project for android build makes ovrplayercontroller run along the floor in editor (VR) 0 Answers
Pulling Object forwards and back "Oculus VR" 0 Answers
Script for syncing Oculus VR player position with VR headset not working as intended 1 Answer
Unity for OculusGo: Move an object along the z axis by touchpad 0 Answers