Search Unity

  1. Want to see 2020.1b in action? Sign up for our Beta 2020.1 Overview Webinar on April 20th for a live presentation from our evangelists and a Q&A session with guests from R&D.
    Dismiss Notice
  2. Interested in giving us feedback? Join our online research interviews on a broad range of topics and share your insights with us.
    Dismiss Notice
  3. We're hosting a webinar for the new Input System where you'll be able to get in touch with the devs. Sign up now and share your questions with us in preparation for the session on April 15.
    Dismiss Notice
  4. 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:
    612
    Last edited: Mar 30, 2016
    MrEsquire likes this.
  4. EdBlais

    EdBlais

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    283
    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:
    612
    Very cool! Problem solved, not a bug at all just VR cam upgrade! Thanks :)
     
unityunity