i have a top down view game, where you can move arounds with w,a,s,d and you make the character look around with the mouse(the camera is stationary), i wanted to shoot a ray to collide with the terrain, to then create a point so i can calculate my characters rotation. When i draw the ray in the debug mode, it just shoots backwards from the camera. How do i make it shoot to the ground?
#pragma strict
var Cam : Transform;
function Update()
{
Debug.DrawRay (Cam.position, Input.mousePosition, Color.green);
}