Hi,
I have a camera script that relies on main camera and ScreenPointToRay, but am now trying to implement a more elaborate camera management script.
Basically, I have a ‘focus’ object which position is conformed to the character controller plane, with an update function that sets the focus position to the ScreenPointToRay collision.
Simply put, the focus position changes in x and z only, as you move the mouse around the character controller.
The problem is that, if I move the camera, the ‘focus’ position changes, since I ScreenPointToRay from the camera!
Is there a way to, say, ‘ScreenPointToRay’ from a world position, rather than a camera?
I basically need to retrieve the world coordinates of an ‘Input.mousePosition’, with a ray that originates from a world point, rather than a camera.
Any help appreciated.
Thanks.