private void OnCollisionEnter(Collision collision) { Vida script = collision.gameObject.GetComponent <Vida>(); if (script != null) { script.doDamage(damage); } Destroy(this.gameObject); }