I mean by jumping that the moving object between the waypoints is changing position like jumping to another position it’s very quick and small change but you can see it.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Waypoints : MonoBehaviour
{
public GameObject[] waypoints;
public int num = 0;
public float minDist;
public float speed;
public bool rand = false;
public bool go = true;
// Update is called once per frame
void Update()
{
float dist = Vector3.Distance(gameObject.transform.position, waypoints[num].transform.position);
if (go)
{
if (dist > minDist)
{
Move();
}
else
{
if (!rand)
{
if (num + 1 == waypoints.Length)
{
num = 0;
}
else
{
num++;
}
}
else
{
num = Random.Range(0, waypoints.Length);
}
}
}
}
public void Move()
{
transform.LookAt(waypoints[num].transform.position);
transform.position += gameObject.transform.forward * speed * Time.deltaTime;
}
}
I recorded a very short video clip showing the problem what I mean by jumping position: