βQuick Start
1 - Import Playable Vehicle AI package

2 - Dependencies
3 - Layer & Navmesh
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.

Last updated