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;
}
}
}