How do i make this object move after a specific distance

So i am making procedural walking for my character and the ik controller / target dosent move to the target point here is the code

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RaycastThing : MonoBehaviour
{
    [SerializeField] private Transform Leg;

    public float Dist_;

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

    }

    // Update is called once per frame
    void Update()
    { 
        float minDist = 1a;

        Dist_ = Vector3.Distance(Leg.transform.position, gameObject.transform.position);
        Debug.DrawLine(gameObject.transform.position, Leg.transform.position, Color.blue);

        if (Dist_ > minDist)
        {
            Leg.transform.position = gameObject.transform.position;
        }

    }
   


}

ok i found the problem turns out the script that holds the target in place when i move the whole character makes it not work so i have to use another script with raycasts