Why does my 2D raycast keep firing at the 0,0,0 world position?

I’m trying to get a raycast to fire from a character sprite on click but for some reason the Debug.DrawLine keeps showing it going to world point 0,0,0 no matter where the character is. Here is the script:

public float fireRate = 0;
    public float Damage = 10;
    public LayerMask ignoreHit;
    public Transform firePoint;

    float timeToFire = 0;

    void Awake()
    {
        if (firePoint == null)
        {
            Debug.LogError("No firepoint");
        }
    }

    void Update()
    {
        if (fireRate == 0)
        {
            if (Input.GetButtonDown("Fire1"))
            {
                Fire();
            }
        }
        else
        {
            if (Input.GetButton("Fire1") && Time.time > timeToFire)
            {
                timeToFire = Time.time + 1 / fireRate;
                Fire();
            }
        }
    }

    void Fire()
    {
        RaycastHit2D hit = Physics2D.Raycast(firePoint.position, Vector2.right, 100, ignoreHit);
        Debug.DrawLine(firePoint.position, hit.point, Color.green);
    }
}

Is it the raycast doing this or is the debug line inaccurate?

If your ray doesn’t hit anything then hit.point isn’t changed from the default value (0, 0, 0). Try something like

if(hit.collider!=null){
    Debug.DrawLine(firePoint.position, hit.point, Color.green);
}
else{
    Debug.DrawRay(firePoint.position, Vector2.right, Color.red);
}