Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Physics Raycaster does not work when VR is enabled

Discussion in '5.4 Beta' started by bullardo, Mar 24, 2016.

  1. bullardo

    bullardo

    Joined:
    Jan 5, 2013
    Posts:
    46
    Just thought I would put it out there the physics raycaster does not work when VR is enabled. Works fine with it disabled.
     
  2. Alex-Lian

    Alex-Lian

    Guest

    Could you please submit a bug report with a small repro and post the number here?
     
  3. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
    Last edited: Mar 30, 2016
    MrEsquire likes this.
  4. EdBlais

    EdBlais

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    311
    We've made some changes internally to the Camera viewport rects to fix viewport issues in VR. With this change, the Screen.width and height no longer represent the resolution of the HMD. Screen represents the game view and the HMD resolution is now represented by VRSettings.eyeTextureWidth and VRSettings.eyeTextureHeight. So if you raycast using the Game View's width and height, the ray will be incorrect for VR cameras unless your Game view resolution is the same as the HMD.

    You just need to update the GazeInputModule script to use the HMD resolution rather than the Screen resolution.
     
    taxvi and Selzier like this.
  5. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
    Very cool! Problem solved, not a bug at all just VR cam upgrade! Thanks :)