distance

Im trying to work out the distance between my player and an enemy,

playerDistanceFromEnemy = Vector3.Distance(transform.position, playerPos);

But this gives me errors, that its overloaded. The script is on my enemey and playerPos is declared as :transform so I can drag the player to it in the inspector, when I set the var to Vector 3, it works but then it cant tell where the player is… any ideas?

if playerPos is declared as a Transform, use playerPos.position.

cheers