RayCast not detecting item?

I’m using a raycast and for some reason its not detecting the item the player is looking at.

	if(Input.GetButtonDown("Fire1")){
		var hit : RaycastHit;
		if (Physics.Raycast (transform.position, transform.TransformDirection(Vector3.forward), hit)){
			Distance = hit.distance;
			if (Distance < maxDistance)
			{
				hit.transform.SendMessage("ApplyDammage", dammage, SendMessageOptions.DontRequireReceiver);
			}
		}
	}

No it works fine with my floor object, but not the object enemy… Just wondering if someone could help me with this issue. Thanks.

this:

if(Input.GetButtonDown("Fire1")){
       var hit : RaycastHit;
       if (Physics.Raycast (transform.position, transform.TransformDirection(Vector3.forward), hit,100)){
         Distance = hit.distance;
         if (Distance < maxDistance)
         {
          hit.transform.SendMessage("ApplyDammage", dammage, SendMessageOptions.DontRequireReceiver);
         }
       }
    }