this is my code. it works but the enemy ai behaviour is weird and the hitbox is gone, i'm a beginner and this is not my code
private Transform target;
public int MoveSpeed = 4;
public int minRange;
public bool follow;
public float scoreOnDeath;
private Player player;
void Start(){
player = GameObject.FindGameObjectWithTag ("Player").GetComponent ();
GameObject go = GameObject.FindGameObjectWithTag ("Player");
target = go.transform;
}
public override void Die() {
player.AddScore (scoreOnDeath);
base.Die ();
}
void Update ()
{
if(Vector3.Distance(transform.position,target.position)
↧