VRPC Switch Example


One of the best features that we like about the VR Module, is the ability to switch between playing on the Desktop and playing in VR. To demonstrate this, we have included a simple example. The game play starts with the Main Camera and Keyboard control of the Player Character. However, you will see that we have added the XR Rig and the XR Manager to the scene, configured them, and set inactive.


We can then use the Action Activate XR to toggle between VR mode and Desktop mode. You will need to configure the Action by dragging in the appropriate Game objects from the Hierarchy.


We have set the On Key Down (Key 1) to Activate the VR, and the Button 1 (A on a Quest) to switch back. Another way to do this would be from a UI Canvas and use a Screen Space button to Activate VR, change the Canvas to world space with a button to close it. The Canvas could also show the control layout of either Input.


Any Keyboard Triggers for Player control, just drag the associated Action to a Controller button and it will work the same. You can also mix and match Camera Motors, 3rd person (Adventure) on the Desktop, and 1st person in VR. 


We have also added the Change Character Movement settings Action, and this allows you to set the Left or Right Thumbstick, (Make sure the TouchStickVRMovement Prefab has been added to GC Preferences), as well as override the arm movement when walking or running.



You will need to ensure the link to the PC is working using either Cable, Airlink or Steam. If you find the Head positioning when you enter VR is not correct, this means that the VR Tracking of your Headset needs to be reset.

Useful Links

Pivec Labs









Full list