//This target only interacts with enemy layer (set in Unity's physics) public void OnTriggerEnter(Collider other) { if (other.GetEnemy() == targetEnemy) { Destroy(gameObject); } }
//This target only interacts with enemy layer (set in Unity's physics) public void OnTriggerEnter(Collider other) { if (other.GetEnemy() == targetEnemy) { Destroy(gameObject); } }