Raycast works right in browser, but doesn’t works when enter to the VR mode simulation.
foxfairlane last edited by
When you enter in the VR Mode, the raycast from mouse cursor has a big offset. If you try in a mobile phone VR, the offset is different and bigger.
You can check it out in this jsfiddle https://jsfiddle.net/foxfairlane/d3t7khvu/4/
Do click several times and different positions on the screen and you will see how the ray is just under your mouse cursor position. It's working right.
Now you press the "Enter VR" button to enter in VR mode and try to do the same. You will see how the ray is offset from your mouse cursor position. It's not working right.
I already changed the camera to renderer.xr.getCamera(), for function raycaster.setFromCamera(mouse, camera)
If you try VR in a phone, the offset is different and bigger than VR PC Browser.
How I could fix this problem???