How can I make a follow script for my AI system?I’ve made this code until now:
var size=10;
var player:Transform=player;
function Update () {
find_player();
}
function find_player()
{
var dist=Vector3.Distance(player.position,transform.position);
if(dist<10){
transform.LookAt(player);
follow();
}
}
function follow()
{
//Waiting for a response
}
So now enemy faces of the player,but how can it follow him?
Thanks!