You can make your path mesh, using only edges, no faces (the algorithm would become… difficult).
Make a pathfinding algorithm to find out where your player/character/vehicle is looking to go (For example - if the player is detected by a certain raycast, head in that direction <-- incredibly basic), this could be an existing algorithm (A*, Dijkestra, etc) or your own (I use my own because there may be features of the other algorithms that aren’t needed.
(Easiest is if you don’t need pathfinding - just merely a way to follow a set path, from vertex to vertex)
Sorting that out, you’d need to make a script iterate by getting the co-ords of the “next vertex” (This would be determined by a for loop,perhaps using a set-up similar to this:LikeAFor.blend (128 KB)
as there are problems with simple iterations.
Then add the objects global co-ords (the vertex co-ords retrieved will be in local co-ords) to this. In the script, each iteration should:
Player’s X = Player’s X + ((Player’s X - Vertex global coords)/ Num_of_Iterations)
Player’s Y = Player’s Y + ((Player’s Y - Vertex global coords)/ Num_of_Iterations)
Player’s Z = Player’s Z + ((Player’s Z - Vertex global coords)/ Num_of_Iterations)
That will basically smoothly move the object in question to the next vertex.
make the above iteration selective (In an IF statement -
“if player’s X - vertex Global coord’s > Max_Distance and player’s Y - vertex Global coord’s > Max_Distance and player’s Z - vertex Global coord’s > Max_Distance:”
If you still follow, I’ll add the “rest” because it gets a bit “messy”, but otherwise I’ll try and find another way to help, perhaps a small demo…