Make a car with Unity's Vehicle Tools physics follow a path

Hey guys!

Recently I have been playing around with the Vehicle Tools asset by Unity. It made it very easy for me to quickly generate and modify functional vehicles with all the needed physics.

Now I am wondering how to make a simple AI script to make the vehicles follow a path with all the physics of the Vehicle Tools. This could be either done by using the awesome Path Creator by SebLague on GitHub or maybe just by few empty game objects acting as waypoints.

I did my research but couldn’t find a proper solution and couldn’t put it all together so I am feeling stuck at this point, even though it seems like a pretty simple thing to do.

Any help is appreciated!

In the vehicle demo scene there’s an AI that follows a path iirc, check out how it’s built.

Hi,

Another option might be making a small script to steer towards the list of waypoints, in turn.

I checked the scene but there doesn’t seem to be anything like that, only 3 vehicles that can be driven around the track.

Not exactly sure what you mean by that.

Check if the current way point is at the left or right of the car, and steer accordingly. When close enough, switch target to the next way point, and so on.

(Haven’t thought about it that much… :slight_smile:

I was thinking about car AI that is in the standard assets.