Vector3.Distance error plizzzzzz help

im always getting a NullReferenceException: Object reference not set to an instance of an object at line 4 no matter what i try, there is a game object with tag Enemy but it wount work

function Update () {
var target = GameObject.FindWithTag ("Enemy");

if ( Vector3.Distance(target.position, transform.position ) < 25) {
	print("found it");
}

}

If you’re looking for a gameobject with the tag player, then trying to get the position from it like this:

Player.position

That won’t work, because to get the position of a gameobject, you must first access the gameObject’s transform.

Player.transform.position

The same is with rotations too:

Player.transform.rotation

Link to GameObject documentation: Click Here

the first line after you open up the function should be
GameObject.FindGameObjectWithTag( “Enemy” );