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;

function Update () 

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

        //if distance is less than what is specified then do something

            //print("stop attack");
            GetComponent(SmoothLookAt).enabled = false;
            //GetComponent(ConstantForce).enabled = false;



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


try checking freeze rotation in rigidbody component of the enemy.