Refactored onHit code into a GameObject method, which is then overriden.