After modifying my main camera’s projection matrix, all methods that use ray casting (OnMouseDown, ScreenPointToRay) begin to fail. From what I can tell, the ray continues to use the camera’s original matrix.
Is there any way to force a ray to use a custom projection matrix?
you multiply the point by the inverse matrix of your projection matrix, but the viewport point not the screen point , the result will be a point in world space which means the same space for all other objects in the scene , then you can use Physics.Raycast or Physics.Linecast for testing
Hi,
Has anybody already solved this?
I’m having same problems. I have a custom projection matrix on my camera and raycast doesn’t work. Can anybody help me please?