+ 1
How can I make an NPC Car follow a path specified by an array?
I have a Vector2 array named path, where for each element the first number is the value on the x-axis and the second number is the value on the z-axis of a certain point in space. The values on y-axis can be decided by gravity. In other words, if the path array has elements (0,0), (1,0) and (1,1), the NPC car has to move from the start to finish by following that pattern. How can I code for this so that the car not only follows the specified path, but also rotates accordingly when it needs to make a turn?
1 Respuesta
0
Well I am unsure if this is what you are after but here is a link to something that might help you out. http://www.trickyfast.com/2017/09/21/building-a-waypoint-pathing-system-in-unity/