I have been developing a script for an fps game that looks like this:
function Update () {
var MouseScreenPosVector3 : Vector3 = GetComponent.<Camera>().ScreenToWorldPoint (Vector3 (Input.mousePosition.x, Input.mousePosition.y,10));
transform.LookAt(MouseScreenPosVector3);
}
However this script does not work, I have seen many people use it but the issue I have is that every frame it tries to look at the mouse it moves the whole screen, moving the location of the mouse that it needs to look at. How can I fix this?