I have a basic pathfinding script but what I’m finding is that the object following me doesn’t avoid buildings or other objects, you can be running and then when you go round the corner of a building the zombie just walks into the wall. What I need is (if possible) could somebody please offer a script or just improve on the current script I have.
var speed : float=0.2;
var target : GameObject;
function Start () {
}
function Update () {
transform.Translate(Vector3.forward*speed);
transform.LookAt(target.transform.position);
}
Can you please use JavaScript because its all I know but I don’t care if it is in C# or anything else as long as you tell me what.