private void OnCollisionEnter2D(Collision2D other) { //we also add a debug log to know what the projectile touch Debug.Log("Projectile Collision with " + other.gameObject); BackAndForth enemyController = other.gameObject.GetComponent <BackAndForth>(); if (enemyController != null) { enemyController.Fix(); } Destroy(gameObject); }