GameObject.FindWithTag("Player") not working.

#pragma strict

var player : GameObject;
function Start () {
player = GameObject.FindWithTag("Player");
}

function Update () {

if (!Physics.Linecast (transform.position, player.position)) {
            Debug.DrawLine (transform.position, player.position, Color.green);
            Debug.Log ("Player in sight!");
        }
        else{
         	Debug.DrawLine (transform.position, player.transform.position, Color.red);
         	Debug.Log ("NO Player in sight!");
         	}


}

Why does this not work? It says (10,51): BCE0019: ‘position’ is not a member of ‘UnityEngine.GameObject’.

How can i fix this?

Player is of type GameObject.

  Debug.DrawLine (transform.position, player.position, Color.green);

here you are trying to access player.position and this is the error.

two lines later:

  Debug.DrawLine (transform.position, player.transform.position, Color.red);

you use player.transform.position and magically no error.

Conclusion?