cancel
Showing results for 
Search instead for 
Did you mean: 

Fixing the Physics raycaster in Unity 5.4

bullardo916
Explorer
Unity 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.

I'm sure this would be very difficult to troubleshoot and not to mention all the Oculus samples will be broken. 
1 REPLY 1

manni1981
Honored Guest
o my god, thanks. i didn't get that and was wondering why my code didn't work...