- Home /
How to Build different scenes with different player settings and properties?
i have created a Vr game in which i want my first two scenes to be in PC mode and the final Scene to be in VR mode. Once VR mode is enabled all the scenes are enabled with VR settings.but i need my first scene to be normal and the next scene to be in Vr,
Help me out guys.
Answer by DawidNorasDev · Jun 18, 2018 at 07:50 AM
I've done similar thing on Android. I had the non VR scene and than a button leading to VR experience. In project settings where you select VR SDK, add SDK named "None", ane put it on top (as the first SDK in list). Unity will launch with this SDK thinking that it's normal (non VR) application. When you want to switch to VR, you need to do 2 things:
XRSettings.LoadDeviceByName(string devide name); // in my case: "none" or "cardboard" and XRSettings.enabled = true; //or false, if you want to exit VR
Note: In earlier unity versions, it will be VRSettings, not XRSettings
Also, I had a problem I don't remember now, that I had to wait one frame after loading the device, before enabling XRSettings. (Simple do it by calling it in corutine placing "yield return null" in between)
Answer by tormentoarmagedoom · Jun 18, 2018 at 07:53 AM
Good day.
I don't know how VR mode works, but i can imagine is just a scene like any other, but with VR Inputs/Outputs.
So you need to create the scenes with a "initial bool variable" to know if is PC mode or VR mode to activate/Deactivate Pc/VR Inputs.
Or, maybe is better to create one scene for VR and a copy of the scene for PC.
Yo ushould reat/watch some tutporials about how to config a scene for VR mode.
Good luck! Bye!