Example #1
0
    private void performHug()
    {
        Collider[] hitColliders = Physics.OverlapSphere(transform.position + transform.rotation * new Vector3(0, .5f, 1.5f), 1.5f);
        int        i            = 0;

        while (i < hitColliders.Length)
        {
            Follower f = hitColliders[i].gameObject.GetComponent <Follower>();
            if (f != null)
            {
                f.AttemptFollow(followObject);
            }
            i++;
        }
    }