Search Unity

VR mode toggle

Discussion in 'AR/VR (XR) Discussion' started by Kelly-Chang, Sep 22, 2016.

  1. Kelly-Chang

    Kelly-Chang

    Joined:
    Sep 22, 2016
    Posts:
    1
    I've been searching for vr mode toggle but it seems to be for older versions. anyways, im still new in unity3d.

    I've tried from this vid, but it seems like thers an error. why?

    i dont own the video.

    the error comes from the playerpref. i've changed the cardboard.SDK to GvrViewer.Instance

    please do help. :) thanks alot.
     
  2. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    When you say toggle, are you looking for a script property you can change on the fly or are you looking for a setting that enables VR Mode?

    For the former, VRSettings.enabled will toggle VR mode.

    For the latter, Player Settings -> Virtual Reality Supported will toggle VR and allow you to select the VR Device you want to target.
     
  3. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652