using UnityEngine; public class SwordSlash : Ability { public LayerMask entityLayer; //probably will change out entity detection. or will i? //i'd also probably have to offset the damage origin direction public float damageRadius; protected override void AbilityEffects() { base.AbilityEffects(); Collider2D[] entitiesFound = Physics2D.OverlapCircleAll(thisEntity.stats.attackOriginPoint.position, damageRadius, entityLayer); foreach (Collider2D entityFound in entitiesFound) { if (!entityFound.CompareTag(thisEntity.tag)) { if (entityFound.TryGetComponent(out Entity isEntity)) { isEntity.stats.TakeDamage(power); } } } } }