enemy가 이상하게 player가 움직이면 멈춰서 그자리를 빙빙 돌다가 플레이어가 멈춰야지 따라오네요....
왜 이러는 걸까요?
대충 ↓
void Update{
distance = Vector3.Distance(Player.transform.position, transform.position);
if (distance > this.GetComponent<NavMeshAgent>().stoppingDistance)
{
if (!nav.pathPending) {
nav.SetDestination(Player.transform.position);
}
ess = EnemyState.trace;
anim.SetFloat("speed", 1, 1, Time.deltaTime);
anim.SetBool("Attackend", false);
}
}
코드상으로는 이런 부분인데 뭐가 잘못 된걸까요 ㅠㅠ