void Awake() { player = GameObject.FindGameObjectWithTag("Player"); playHealth = player.GetComponent <PlayHealth> (); enemyHealth = GetComponent <EnemyHealth>(); anim = GetComponent <Animator> (); }
void Awake() { player = GameObject.FindGameObjectWithTag("Player").transform; playHealth = player.GetComponent <PlayHealth> (); enemyHealth = GetComponent <EnemyHealth> (); nav = GetComponent <UnityEngine.AI.NavMeshAgent> (); }