private void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Enemy")) { EnemyBehaviour eb = other.gameObject.GetComponent <EnemyBehaviour>(); if (eb.dead == true) { return; } enemys.Add(other.gameObject); pc.FoundTarget(); other.gameObject.GetComponent <EnemyBehaviour>().lockOn.SetActive(true); } }