Code not working, don't know why

This code is attached to a projectile which is supposed to lock on to the closest object tagged with Enemy. I have no idea why my code doesn’t work, so i am hereby asking if anybody knows how to fix it.

#pragma strict
var target : Transform;
var damage = 200;
var rocketexplosion : AudioClip; 
var addedscore : float = 200;
var myTransform : Transform;
var moveSpeed = 50;
var traceable : boolean;
var distance;

//also irrelevant for finding enemy just does damage and makes an explody sound
function OnCollisionEnter (col: Collision) {
	if (col.gameObject.tag == "Enemy"){addScore();}
    
    if (col.gameObject.tag == "Enemy"){
    var target: GameObject = col.gameObject;
   
    target.collider.SendMessage("ApplyDamage", damage, SendMessageOptions.DontRequireReceiver);
    
    audio.PlayOneShot(rocketexplosion);{yield WaitForSeconds (0.3);{Destroy (gameObject);}}}
} 

function Awake(){
myTransform = transform;
var target : Transform = FindClosestEnemy();
}

function Start (){
yield WaitForSeconds (2);{ Destroy(gameObject);
distance = Vector3.Distance(target.position, myTransform.position);
}}
//// irrelevant for finding enemy just to add score if it hits
function addScore(){
var ptarget : GameObject = gameObject.Find("player");
ptarget.gameObject.SendMessage("AddScore", addedscore, SendMessageOptions.DontRequireReceiver);
}

function Update(){

transform.LookAt(Vector3(target.position.x, target.position.y));
myTransform.Translate(Vector3.forward * moveSpeed * Time.deltaTime);

}

	// Print the name of the closest enemy
	print(FindClosestEnemy().name); 
	
	// Find the name of the closest enemy
	function FindClosestEnemy () : GameObject {
		// Find all game objects with tag Enemy
		var gos : GameObject[];
		gos = GameObject.FindGameObjectsWithTag("Enemy"); 
		var closest : GameObject; 
		var distance = Mathf.Infinity; 
		var position = transform.position; 
		// Iterate through them and find the closest one
		for (var go : GameObject in gos)  { 
			var diff = (go.transform.position - position);
			var curDistance = diff.sqrMagnitude; 
			if (curDistance < distance) { 
				closest = go; 
				distance = curDistance; 
			} 
		} 
		return closest;	
	}

Put your line of code that sets the target var in the start method. The awake method calls when the object is instantiated, and it could be first, and your enemies will not exist yet. The start method gets called after all your objects have been instantiated