Environment:
- Unity 5.6
- VR is active and rendering to the HMD
My goal is to raycast from the mouse into the scene, with a VR camera.
When using ScreenPointToRay on a VR camera the ray's direction is way off. Here's an image when my cursor was in the center:
![[IMG]]()
When using ViewportPointToRay the ray's direction is much better but still not perfect. Here's an image showing the difference (sorry for mouse pic, my screen capturer wasn't picking up...
ScreenPointToRay and ViewportPointToRay not working with VR
- Unity 5.6
- VR is active and rendering to the HMD
My goal is to raycast from the mouse into the scene, with a VR camera.
When using ScreenPointToRay on a VR camera the ray's direction is way off. Here's an image when my cursor was in the center:
![[IMG]](http://i.imgur.com/5uq97Bb.png)
When using ViewportPointToRay the ray's direction is much better but still not perfect. Here's an image showing the difference (sorry for mouse pic, my screen capturer wasn't picking up...
ScreenPointToRay and ViewportPointToRay not working with VR