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)
{
}
}
}