public void OnTriggerEnter(Collider2D other) { if (other.tag == "Edge") { enemy.changeDirection(); } }