Model flipping upside down when chasing player.

I recently found a script to make something chase the player. I tried using this script with the base male model from the unity store and it worked perfectly. Then I made a model on blender and imported it into unity. Like most models from blender I had to fix the colours, no biggie. I then attached the scripts, added the colider, rigid body, everything I did to the base male model. I clicked play and when I found the character, this is what happened. [15242-screen+shot+2013-09-08+at+11.48.01+am.png|15242]

I don’t know why this is happening please help. Here is the script:

private var theCollider : String;

var Guard : Transform;
var Player : Transform;
var MoveSpeed = 4;
var MaxDist = 10;
var MinDist = 5;
 
 
function Start () 
{
 
}
 
function Update () 
{
    transform.LookAt(Player);
 
    if(Vector3.Distance(transform.position,Player.position) >= MinDist){
 
         transform.position += transform.forward*MoveSpeed*Time.deltaTime;
         Guard.animation.Play();
 
 
         if(Vector3.Distance(transform.position,Player.position) <= MaxDist)
             {

   } 
   }
}

This object probably is weirdly aligned to the axes: the red-green-blue arrows apparently show its actual orientation (if the button Local/Global in the Editor is set to Local). The line transform.LookAt(Player); makes the character point its local Z axis to the player and align its local Y to world Y, thus any rotation you’ve previously set in the Editor is lost when you run the game. Your hierarchy probably is something like this:

Creature // scripts attached to this game object
  Model // model childed to the Creature empty

In the Editor, reset the Creature object rotation, then select and rotate the Model to the correct orientation. You’ve probably rotated the Creature instead, thus it restored its original up direction when LookAt was executed.