I’m trying to get an object to point toward the nearest object under the mouse. This is what I have for code right now…
function Update () {
var hit : RaycastHit;
if (Physics.Raycast (Input.mousePosition,Input.mousePosition,hit)) {
transform.LookAt (hit.point);
}
}
I’m guessing I’m not even close…