protected virtual void NearbyObjects() { Collider2D[] collider2Ds = Physics2D.OverlapCircleAll(transform.position, GetComponent <CircleCollider2D>().radius, LayerMask.GetMask("Allies")); if (collider2Ds.Length > 0) { completion -= 0.5f; if (hostile && enemies.Characters.Count > 0) { var Characters = collider2Ds[Random.Range(0, collider2Ds.Length)].gameObject.GetComponent <PartyController>().CharacterList; Characters.Attack(enemies); enemies.Attack(Characters); } } if (completion <= 0 && collider2Ds.Length > 0) { OnQuestCompleted(collider2Ds[Random.Range(0, collider2Ds.Length)]); } }