void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "Player") { Debug.Log("Hit!"); MovementPlayer mp = player.GetComponent <MovementPlayer>(); if (mp) { mp.Damage(bulletDamage); } Destroy(gameObject); } }