Search Unity

Strange behaviour of Google Cardboard SDK raycast distance

Discussion in 'AR/VR (XR) Discussion' started by Fostac, Jan 10, 2018.

  1. Fostac

    Fostac

    Joined:
    Jun 23, 2017
    Posts:
    7
    Hi,

    I'm using Unity 2017.1.1f1 and the Google Cardboard SDK to develop a VR project and I have the following problem:

    I'm using the GvrPointerPhysicsRaycaster to trigger events when looking at buttons (like a light switch). The distance in which the raycast triggers the objects seems to be shorter than it should be. Increasing the RETICLE_DISTANCE_MAX does not have an effect.

    On the picture below you see your camera pointing at the light swicth (quad with the number one on it) but it doesnt trigger the event (reticle does not open, the value "timer" does not decrease.
    tooFar.jpg


    When moving the lightswitch closer to the camera (ingame) at a certain distance it starts to trigger the event.
    closeenough.jpg

    Again, the RETICLE_DISTANCE_MAX has no effect, I have set it to 50 in the pictures below.
    There are several rooms in the game that you can enter by teleportation. It even seems that in different rooms the distance that is needed to trigger even changes ?!? When I put the camera and the button nearer in the editor, sometimes the distance that has formerly been close enough is not close enough anymore when the game runs.

    Anyone has an idea what could cause this?
     
  2. fredsa43

    fredsa43

    Official Google Employee

    Joined:
    Aug 31, 2016
    Posts:
    8
    Hi Fostac, what version of The Google VR SDK for Unity are you using?

    Can you try the HelloVR scene in the latest SDK (currently 1.120)?
    While playing in the editor you can see that max reticle distance is working by
    - Changing the "Player > Main Camera > GvrReticlePointer" game object's "Max Reticle Distance" via the inspector
    - Changing the position of the "Treasure > QuadSphere/TriSphere/Icosahaderon" game object's position to move it further/closer away from the camera
    - Using ALT+mouse in the Game view to emulate head movement
     
  3. Fostac

    Fostac

    Joined:
    Jun 23, 2017
    Posts:
    7
    Hi fredsa,

    thanks for answering.

    I have been using SDK 1.50. Following your advice I have updated to the current SDK. And now everything works as expected :)

    Though I don't know what went wrong in the first place. In the pictures above the debug ray clearly goes through the light switch but didnt trigger it.

    Anyway, thanks a lot!
     
  4. fredsa43

    fredsa43

    Official Google Employee

    Joined:
    Aug 31, 2016
    Posts:
    8
  5. ReveConsulting

    ReveConsulting

    Joined:
    May 3, 2018
    Posts:
    1
    I'm using SDK version 1.19 and am experiencing the same issue.
     
  6. dmennenoh

    dmennenoh

    Joined:
    Jul 1, 2015
    Posts:
    379
    I was having the same issue, to stop the reticle responding I just disabled the collider on the object.