This commit is contained in:
LeeJaeHyun 2024-09-12 16:46:01 +09:00
parent 1c6282b65a
commit 7e4194be49

View File

@ -25,8 +25,10 @@ public class MonsterController : MonoBehaviour
{
playerTr = GameObject.Find("Player").GetComponent<Transform>();
monsterTr = transform;
agent = GetComponent<NavMeshAgent>();
StartCoroutine(CheckMonsterState());
StartCoroutine(MonsterAction());
}
IEnumerator CheckMonsterState()
@ -63,6 +65,9 @@ public class MonsterController : MonoBehaviour
break;
case State.TRACE:
// 추적 시작
agent.SetDestination(playerTr.position);
agent.isStopped = false;
break;
case State.ATTACK: