- Home /
Editor Crashes When Switching from VR to Standalone
Hi guys I am making a game in which i have both first person mode and VR mode.
Till now i am able to select VR mode correctly but after i come back and select FPS and play then my game just Crashes i don't understand why ?
I am using unity GUI for my menu and i am also using virtual reality tool kit(VRTK).
I have observed that when I select VR mode the unity UI standalone Input Module class shuts down so I enabled it after returning then UI works but after starting the game it crashes
This is the code I am using to turn the device on
//StartCoroutine(VRSpecificSettings_Ref.LoadDevice("OpenVR")); this line for VR Player
//StartCoroutine(VRSpecificSettings_Ref.LoadDevice("")); this for non VR
public IEnumerator LoadDevice(string newDevice)
{
VRSettings.LoadDeviceByName(newDevice);
yield return null;
if (newDevice != "")
{
VRSettings.enabled = true;
GameObject go = GameObject.Find("SpawnPoint");
vrClone = Instantiate(VRPlayer, go.transform.position, Quaternion.identity) as GameObject;
ActivateIconsVR();
Invoke("invokeIT", 1.0f);
}
else
{
VRSettings.enabled = false;
}
}
Comment