LookAt Enemy without orbit?

Hello guys.

Im currently working on a melee combat project, I am almost done but I have just found a problem, I want to be facing the Enemy during the combat, for that I used LookAt() when the enemy is in a certain range. The problem is that, when the enemy is in range I look at him but my character starts like orbiting around him (horizontal and vertical), even if jump, this just gets off if I get him out of the range but how can I face him just in a horizontal way?

Any idea?
Thanks

This has been asked many times.

basically you just bring the two position to the same y-level so it only rotates around the y-axis.

// C#
Vector3 lookTarget = target.transform.position;
lookTarget.y = transform.position.y;
transform.LookAt(lookTarget);


// UnityScript (JS)
var lookTarget : Vector3 = target.transform.position;
lookTarget.y = transform.position.y;
transform.LookAt(lookTarget);