private void OnCollisionEnter2D(Collision2D collision) { if (transform.parent != null) { HPScript a = collision.gameObject.GetComponent <HPScript>(); if (a != null) { a.ReciveDamage(DMG); } } }