private void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.tag == "Bullet") { // Call the necessary function Aspawner.OnEnemyDeath(scoreValue); // Destroy the game object Destroy(gameObject); // Explosion effectSpawner.EnemyBlowingUp(transform.position, effectSpawner.enemyExplosion, 1); } }