Enemy Mesh rotating off axis

I'm desperately trying to get my enemy to attack my player...i finally created a script to do so and it works fine...HOWEVER, when the enemy is following the player, the mesh of the enemy starts to topple and rotate in very weird directions and it doesn't stand straight...Here is a picture to show what i mean:

alt text

when the enemy gets closer to the player, it starts to rotate horizontally and vertically...how can i make it so the enemy stands straight and attacks like a real enemy would

here is the code i am using and i have a character controller connected to the enemy...please, somebody help me figure out why my enemy is

//object to be followed
var detectObject: Transform;
//distance that will trigger following action
var distanceDetection: float;
var standing = false;
var attackSpeed = 4;
//var AttackEnemy : GameObject;
private var characterController : CharacterController;
characterController = GetComponent(CharacterController);

function Start()
{
        //animation.wrapMode = WrapMode.Loop;
        //animation.Play("idle");
}

function Update () 
{

    if (detectObject)
    {
        var dist = Vector3.Distance(detectObject.position, transform.position);

        //if distance is less than what is specified then do something
        if(dist<distanceDetection)
        {
            //print("attack");
            //animation.CrossFade("walk");
            attack();
            return;

        }
        else
        {
            //print("stop attack");
            //animation.CrossFade("idle");
            GetComponent(SmoothLookAt).enabled = false;
            //GetComponent(ConstantForce).enabled = false;
        }

    }

}

function attack()
{
   direction = transform.TransformDirection(Vector3.forward * attackSpeed);
   characterController.SimpleMove(direction);
   GetComponent(SmoothLookAt).enabled = true;

}

try checking freeze rotation in rigidbody component of the enemy.