Raycast hit on door and doesn't do anything

Hi all, i am trying to detect a mouse click on the door and do something. Can anyone please help me see what wrong with my code snippet? it is not printing “I hit a door” and i don’t know what is happening??

var ray : Ray = Camera.main.ScreenPointToRay (Input.mousePosition);
    		var hit  : RaycastHit;
    		if(Input.GetMouseButtonDown(0))
    		{
    			//print("i click on door");
    			if (Physics.Raycast (ray, hit, Mathf.Infinity)) 
    			{
    				//door is clicked
    				if(hit.transform == "Door1")
    				{
    					print("I hit a door");
    					if(MoveAround.collect == 0)
    					{
    						nochoice = true;
    					}
    					if(MoveAround.collect > 5)
    					{
    						choice = true;
    					}
    					else
    						choice = true;
    				}
                       }
                   }

This line is wrong:

          if(hit.transform == "Door1")
          {

You should compare the object’s name (hit.transform.name) or tag (hit.transform.tag) to “Door1” - hit.transform is a Transform reference, not a string.

var ray : Ray = Camera.main.ScreenPointToRay (Input.mousePosition);
var hit : RaycastHit;
if(Input.GetMouseButtonDown(0))
{
//print(“i click on door”);
if (Physics.Raycast (ray, hit, Mathf.Infinity))
{
//door is clicked
if(hit.transform.tag == “Door1”)
{
print(“I hit a door”);
if(MoveAround.collect == 0)
{
nochoice = true;
}
if(MoveAround.collect > 5)
{
choice = true;
}
else
choice = true;
}
}
}