public void AttackPlayer(CharacterBehaviours character, CharacterBehaviours target) { if (canAttack && Vector2.Distance(character.transform.position, target.transform.position) <= character.Weapon.Range) { canAttack = false; target.TakeDamage(this, character); attacked = true; StartCoroutine("AttackTime"); } }