RunPlayerDetection()

Found in:

protected override bool RunPlayerDetection()
    {
        Collider2D[] colArray = Physics2D.OverlapCircleAll(transform.position, aggroRange);

        foreach (Collider2D col in colArray)
        {
            if (col.gameObject.TryGetComponent(out PlayerController player))
            {
                currentTarget = player.gameObject;
                Debug.Log("Found player");
                return true;
            }
        }
        return false;
    }


Comments

Leave a Reply

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