I need the enemy to move towards the player as soon as it’s at a certain distance.
I got this so far:
public class EnemyDroneAI : MonoBehaviour {
public int runSpeed = 10;
public Transform target;
void Update() {
transform.LookAt(target);
rigidbody.AddForce(transform.forward * runSpeed);
}
}
It doesn’t quite work as the enemy only looks at the player without actually moving. What am I doing wrong?