im making a game and the character modle that i put the script onto makes the modle float up off the floor and then follows you. i even tryied puting a rigid body onto it but he just falls straight through the floor. i will attach the script i was using.
#pragma strict
var target : Transform; //the enemy's target
var moveSpeed = 1; //move speed
var rotationSpeed = 3; //speed of turning
var myTransform : Transform; //current transform data of this enemy
function Awake()
{
myTransform = transform; //cache transform data for easy access/preformance
}
function Start()
{
target = GameObject.FindWithTag("Player").transform; //target the player
}
function Update () {
//rotate to look at the player
myTransform.rotation = Quaternion.Slerp(myTransform.rotation,
Quaternion.LookRotation(target.position - myTransform.position), rotationSpeed*Time.deltaTime);
//move towards the player
myTransform.position += myTransform.forward * moveSpeed * Time.deltaTime;
}