Switching from VR to non-VR mode in the Editor
Here's how to change from a VR to a non-VR player view in the Unity editor:
-
Open your Unity project and make sure you have both the VR and non-VR player controllers set up. These controllers should be separate GameObjects, each with scripts and components attached to the player character.
-
In the Unity editor, locate the XR Origin. This GameObject is responsible for handling the input and movement in the VR environment.
-
Disable the XR Origin. You can do this by right-clicking on the script/component in the inspector and selecting "Disable" or "Remove". The XR Interaction Manager GameObject can remain active
-
Locate the non-VR player controller component. This component is responsible for handling the input and movement in the non-VR environment.
-
Enable the non-VR player controller component. If the component was already added but disabled, right-click on it in the inspector and select "Enable". If the component wasn't added yet, refer back to the previous tutorial on how to set up the non-VR player controller.
-
Save your changes by pressing Ctrl + S (Windows) or Command + S (Mac) or by navigating to File > Save Scene.
-
Enter Play mode by clicking the Play button at the top of the Unity editor or by pressing Ctrl + P (Windows) or Command + P (Mac).
-
You should now be able to see the non-VR player view in the Game view window instead of the VR view. You can use your regular input controls to interact with the game as a non-VR player.
That's it! You have successfully changed from a VR to a non-VR player view in the Unity editor. You can toggle between the two views by enabling/disabling the corresponding player controller scripts or components.