private void OnTriggerEnter2D(Collider2D other) { KinematicBubble kinematicBubble = other.GetComponent <KinematicBubble>(); if (kinematicBubble) { StartCoroutine(kinematicBubble.DestroyBubble()); } }
private void OnCollisionEnter2D(Collision2D other) { KinematicBubble kinematicBubble = other.collider.GetComponent <KinematicBubble>(); if (kinematicBubble) { StartCoroutine(kinematicBubble.DestroyBubble()); myAnimator.SetBool(fireBubbleBlowBoolName, true); gameObject.layer = 11; } // should chagne to corotine // maybe handle in animation event }