This is the system I stuck with and developed. It is effective at making the car drive on its own and can be challenging or easy for the player, depending on how I code it.
Firstly I made the waypoint system itself using the video on waypoints in my research page. I produced the code which can be found below:
Here is the waypoint script. It works by calling each waypoint a node. The OnDrawGizmosSelected function draws a gizmos line between all nodes that are created in the game, this is so I can see the route the car will take much easier.
CurrentWaypoint Vector3 tracks the exact node that the car will target.
onto the ai driving script, the variable waypoints finds every node that has the "Path" tag on them, this is how it tracks where to go.
Here is the AIDrive function, which pulls multiple other functions that make the car drive together. the HandleMotor, HandleTurning and UpdateWheels function are my team mates driving code, without that my AI car wouldn't be able to move.
The AISteer and CalculateDistanceOfWaypoints functions I created myself.
The CalculateDistanceOfWaypoints function is where the car starts to track the waypoints thats in front of them using the currentWay variable.
distanceOffset decided how far ahead the car will target. For example if the distanceOffset is 2, the car will target the node that is 2 nodes in between the cars current node and target node. DistanceOffset helps greatly with turning but can sometimes be too much.
Here is the last section of code I made at this time, this is the AISteer function, which is how the car turns towards the targeted nodes. SteerForce is what does this which is adjustable in the unity editor.
Gizmos.DrawWireSphere draws a sphere around the currently targeted node, so I can see where the car is targeting and if distanceOffset works correctly.
The Results:
Here is a screenshot of the gizmos line and sphere in action. The 2 AI cars in the photo successfully follow the waypoints and drive by themselves. However there were a few issues such as pretty terrible handling, going way too fast and not slowing down. These are issues I have to fix to achieve my goal.