so this code throw out both the errors specified above and i cant find any reason for it. the code it supposed to check if the ray hit something and then return what it hit or that it didnt hit anything. it is all inside the update function.
var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
Debug.DrawRay (ray.origin, ray.direction * 10, Color.green);
If (Input.GetMouseButtonDown (0)) {
If (Physics.Raycast (ray, hit)) {
print (" I am looking at " + hit.transform.name);
}
else {
Print ("I am looking at nothing!");
}
}