my mouseclick Raycast does not work on the Rift cameras
I do a simple Raycast to see if someone clicked on one of my Menu elements with the mouse. Works just fine, except when the Rift is activated. Now I can't get it to work with the Rift and I don't see what I do wrong, so if someone has an idea it would be very much appreciated:
the code is only for one of the cameras, I check against both since I don't know where the mouse cursor is. This is a stupid thing to do anyway since you normally navigate the menu with the Leap Motion Controller, but they want me to keep it usable with a mouse too ... so this is pretty annoying (I might have to remove Rift support because of this if I can't get it to work :? ... noooooooo ).
the code is only for one of the cameras, I check against both since I don't know where the mouse cursor is. This is a stupid thing to do anyway since you normally navigate the menu with the Leap Motion Controller, but they want me to keep it usable with a mouse too ... so this is pretty annoying (I might have to remove Rift support because of this if I can't get it to work :? ... noooooooo ).
RaycastHit hit;
Ray ray = RiftMenuCam2.camera.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(ray, out hit))
{
if (hit.rigidbody != null)
return hit.transform.gameObject;
else
return null;
}
