I have a script to detect if an object has been clicked on but when I click nothing happens
var selectedUnits : Array = new Array();
function Update (){
if(selectedUnits.length <= 0){
if(Input.GetMouseButtonDown(0)){
var hit : RaycastHit;
Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), hit);
Debug.Log(hit.collider.tag);
}
}
}