why when I make the step lower the piece doesn't reach the position?
when its 0.1 its fine. but its not smooth
when its 0.01 it still works but doesnt reach the second position
how can I fix this
public class AnimationScript : MonoBehaviour
{
[SerializeField]
private Transform Character;
[SerializeField]
private Transform Board;
public float step;
public int position;
private void Update()
{
if (Input.GetKey(KeyCode.H)) {
Transform PosTransform = FindPos(position);
GoToPosition(PosTransform);
}
}
public void GoToPosition(Transform Destination)
{
Character.position = Vector3.Lerp(Character.position, Destination.position, step);
}
protected Transform FindPos(int PosNum)
{
return Board.Find(PosNum.ToString());
}