void OnTriggerEnter2D(Collider2D col) { Hurtbox hurtbox = col.gameObject.GetComponent <Hurtbox>(); if (hurtbox != null) { Vector3 hurtboxPosition = hurtbox.transform.position; Vector3 launchDirection = hurtboxPosition - this.transform.position; hurtbox.TakeDamage(damage); hurtbox.TakeHit(0, 0, launchDirection * explosionForce); hurtbox.ApplyEffect(this.effect); } }
void OnTriggerEnter2D(Collider2D col) { //Basic normal bubble stuff Hurtbox hurtbox = col.gameObject.GetComponent <Hurtbox>(); if (hurtbox != null) { hurtbox.TakeDamage(damage); hurtbox.TakeHit(0, hitstun, knockbackVector); hurtbox.ApplyEffect(this.effect); Destroy(this.gameObject); } }