having an enemy turn towards you?

i have an enemy ai set up and everything, but i dont know how to make it rotate towards me with its face facing my, not its side or back. could someone help me?

var player : GameObject;

function Update(){
transform.lookAt(player.transform.position);
}

that will make the object immediatley look in the players direction, providing you assign the ‘player’ variable in that script