void Awake() { player = GameObject.FindGameObjectWithTag("Player").transform; playerHealth = player.GetComponent<MyPlayerHeath>(); enemyHealth = GetComponent<MyEnemyHealth>(); nav = GetComponent<NavMeshAgent>(); }
void Awake() { player = GameObject.FindGameObjectWithTag("Player"); playerHealth = player.GetComponent<MyPlayerHeath>(); anim = GetComponent<Animator>(); }