1 - Import CAR AI package
Import the CAR AI package from the Unity Package Manager, just like any other package (download & import)
Once the package is imported, you should see a new folder called Simon's Asset in your Asset folder. It contains the CarAI folder with all the resources you need to make it work.
Here is a view of the tree structure of thye package:
2 - Dependencies
CAR AI need 2 Unity packages to work find.
the com.unity.ai.navigation and com.unity.animation.rigging
com.unity.ai.navigation is essential. It's used to generate a navmesh surface and calculate the path between each waypoints. See the Layer & Navmesh section
com.unity.animation.rigging is a little less so. It is used to ensure that the driver character has movements that match the movements of the car's steering wheel. See the Driver Character section
3 - Layer & Navmesh
In order for cars to find their way across your terrain, CAR AI needs a navmesh surface. I will guide you in images to create this navmesh surface in a few very simple steps.
1 - Create an empty GameObject and name it NavMeshSurface (or something explicit that you will find easily)
2 - Add the NavMeshSurface component on this new GameObject
3 - In the NavmeshSurface component you will have to fill a agent type, adefault area and bake it based on a layer that will be attached to you roads GameObjects
4 - Click on the Agent Type select then on Open Agent Settings...
5 - This should open the Navigation window. In the Navigation window, create a new Agent Type by clicking on the + button
6 - Name this new Agent Type "Car" or something you will be able to retrieve easily.
7 - Then click on the Area button
8 - Create a new Area by giving a name to the first one that is free. (here it is the Area for cars so I call it Car)
9 - Go back to the Navmesh Surface component and set Agent on "Car" and the Default Area on "Car"
10 - Then, the last step is to set your roads objects on a dedicated layer. To do that, in the Layer select click on "Add Layer..."
11 - Add a "Roads" (or any name that you preffer) layer
12 - Select the parent GameObject of every roads objects in your scene and set the Layer on the one you've just created
13 - Unity will ask if you want to set the layer for all child objects. Click "Yes".
14 - Finally in the "Object Collection" > "Include Layers" field select your layer and click on "Bake".
15 - Once the baking process is done, you should be able to see your Car Navmesh Area when you select your Navmesh Surface object.
That's it... Your Navmesh is ready. But you will have to create some waypoints to allow your car to navigate.
To do that, you can go to the Waypoint page