Help with object "range"

Hello im new to coding with c# and unity on the matter of fact. Im currently trying to add a bool that detects when enemies are “inrange” of my tower. For some reason my script is not detecting when enemies are in range.
public class tower : MonoBehaviour
{

    public Transform Tower;
    public Transform Enemypos;
    public Transform arrow;

    public static int TowerHealth = 10;
    public static float TowerAttackSpeed = 0.2f;
    public static float TowerAttackDmg = 2.0f;
    public static int TowerRange = 12;
    public bool inRange;



    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        float distance = Vector3.Distance (Tower.position, Enemypos.position);

       inRange = (distance < TowerRange);

        if (inRange == false )
        {
            Debug.Log("Test failed");
        }
        
        if (inRange == true)
        {
           Debug.Log("In range");
           Instantiate(arrow, GameObject.FindGameObjectWithTag("Tower").transform.position, Quaternion.identity);
        }
    }

The script needs a few changes, some for the issues you face issues and some for performance like :

     public Transform Tower;
     public Transform Enemypos;
     public Transform arrow;
     public Transform TowerTranform;
 
     public static int TowerHealth = 10;
     public static float TowerAttackSpeed = 0.2f;
     public static float TowerAttackDmg = 2.0f;
     public static int TowerRange = 12;
     public bool inRange;
 
     void Start()
     {
         TowerGO = GameObject.FindGameObjectWithTag("Tower").transform; //Don't repeatedly call this in the "Instantiate" function, just call it once in "Start()"
     }

     void Update()
     {
         if (Vector2.Distance(Tower.position, Enemypos.position) < TowerRange) //If you are making a 2D game, use "Vector2.Distance" instead of "Vector3.Distance"
         {
              IsInRange = true;
         }
         else
         {
              IsInRange = false;
         }
 
         if (inRange == true)
         {
             Debug.Log("In range");
             Instantiate(arrow, TowerGO.position, Quaternion.identity);
         }
         else
         {
             Debug.Log("Test failed");
         }
     }