DamageDetection()

Found in:

private void DamageDetection()
    {
        Collider2D[] colArray = Physics2D.OverlapCircleAll(beakHitBox.transform.position, beakHitRange);

        if (colArray.Length > 0)
        {
            foreach (Collider2D col in colArray)
            {
                if (col.gameObject.TryGetComponent(out PlayerEnergy player))
                {
                    Debug.Log("Beak contact");
                    player.isDamage = true;
                    player.isHealing = false;

                    player.CurrentHealth = SendDamage();

                    _beakHitTimeRemaining = _timeBtwnBeakHit;
                    beakHitOnCooldown = true;
                    return;
                }
            }
        }
    }


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *