Search Unity

Google VR SDK Error: The name `GvrViewer` does not exist in the current context.

Discussion in 'AR/VR (XR) Discussion' started by trlewi, Aug 11, 2017.

  1. trlewi

    trlewi

    Joined:
    Jan 3, 2017
    Posts:
    15
    Downloaded the GoogleVR SDK yesterday and am working in Unity on creating a simple mobile VR application. I am attempting to use the if (GvrViewer.Instance.Triggered){} if statement and I get the following compiler error error CS0103: The name GvrViewer does not exist in the current context.

    I have reviewed the SDK API and the class still exists, does anyone know why my issue would be?

    Code Snippet:

    void Update () {
    if (GvrViewer.Instance.Triggered || Input.GetKeyDown ("space")) {
    RaycastHit hit;

    if (Physics.Raycast (transform.position, transform.forward, out hit)) {
    Debug.Log (hit.transform.name);
    }
    }
    }
     
  2. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    1,092
    If you've downloaded the SDK yesterday you should have version 1.70
    GvrViewer has been removed since version 1.50, you should rely more on auto completion.

    The documentation hasn't been updated since april 2017. This was probably version 1.40 where the GvrViewer still existed.
     
  3. trlewi

    trlewi

    Joined:
    Jan 3, 2017
    Posts:
    15
  4. Ninus_design_Technology

    Ninus_design_Technology

    Joined:
    Nov 6, 2016
    Posts:
    1
    @trlewi how do you fix this i have the same issue
     

    Attached Files: