expecting } found Else and expecting EOF found } ???

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!");
	}
}

I’m not sure if your code doesn’t compile because it’s a mix of different languages, or you just typed it up with some problems. This compiles for me:

		 Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
		 Debug.DrawRay (ray.origin, ray.direction * 10, Color.green);
		 if (Input.GetMouseButtonDown (0))
		 {
			 RaycastHit hit = new RaycastHit();
			 if (Physics.Raycast(ray, out hit)) 
			 {
				 Debug.Log(" I am looking at " + hit.transform.name);
			 }
			 else 
			 {
				Debug.Log("I am looking at nothing!");
			 }
		 }