> For the complete documentation index, see [llms.txt](https://gley.gitbook.io/mobile-traffic-system/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gley.gitbook.io/mobile-traffic-system/setup-guide/vehicle-routes-setup.md).

# Vehicle Routes Setup

Inside Mobile Traffic System you can have multiple vehicle types.

A vehicle type can be used to limit the movement of a specific type of vehicle over your roads. For example, a truck will only be allowed on the first lane of a highway and not allowed at all inside the city.

For any vehicle that has some circulation restriction, you can define its own type.

## Create Vehicle Types

Open the **Settings Window** and navigate to **Scene Setup -> VehicleTypes**

<figure><img src="https://1500817731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuflU4iIzTBjoLH93zTYD%2Fuploads%2FOjM5FhrTU3X8HzqiDiNW%2Fimage_2024-02-07_174032065.png?alt=media&amp;token=57cb4b3e-8fa8-4480-9320-9b0e9d0b5613" alt=""><figcaption><p>Vehicle Types Window</p></figcaption></figure>

To add a vehicle type simply click **Add Car Category** and insert the name for the category in the empty field.

To remove a vehicle type, click the **Remove** button for the category you want to remove.

Press **Save** to apply your settings.

## Assign Category to Vehicle

Open a vehicle prefab, select the root object that contains the Vehicle Component, and navigate to the Vehicle Type property.

All vehicle types defined in the previous step will appear in the drop-down and can be selected.&#x20;

<figure><img src="https://1500817731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuflU4iIzTBjoLH93zTYD%2Fuploads%2FamW37bpz8ShkfQOljWAz%2Fv2-AddCathegory.png?alt=media&amp;token=4adf95fd-b514-4abe-b390-dcc9050f5f5b" alt=""><figcaption><p>Assign Type</p></figcaption></figure>

## Setup Vehicle Routes

To create a special route, you'll have to edit the waypoint at the beginning of the route, to enforce a restriction, and the waypoint at the end of a route to end the restriction.

For example, to restrict truck access on the second lane of this route the following steps are required:

<figure><img src="https://1500817731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuflU4iIzTBjoLH93zTYD%2Fuploads%2FiR3Db5GRJTpLUwOREfLN%2Fimage_2024-02-07_181336408.png?alt=media&amp;token=4da93146-23f3-4410-82af-1aaa9c8c49f0" alt=""><figcaption></figcaption></figure>

Select the waypoint mark with the red X disable the **Truck** from allowed vehicles and press the **Set** button.

<figure><img src="https://1500817731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuflU4iIzTBjoLH93zTYD%2Fuploads%2Fdk8S3c1HX0Emji3PDasJ%2Fimage_2024-02-07_181531269.png?alt=media&amp;token=d05d67ac-9241-43ce-94e2-6a83384191d2" alt=""><figcaption></figcaption></figure>

When the Set button is pressed, the settings from the current waypoint will be transmitted to the entire waypoint system until a waypoint that was manually set is encountered and then will stop propagating&#x20;

Then select the waypoint marked with the green X check back the Truck and press the Set button. This will end the Truck restrictions from this lane.

<figure><img src="https://1500817731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuflU4iIzTBjoLH93zTYD%2Fuploads%2FwPj9VJrmgP9umZgCqur6%2Fimage_2024-02-07_182236134.png?alt=media&amp;token=eb01d1de-1ebc-4aaf-8bc5-8842bcc72dea" alt=""><figcaption></figcaption></figure>

## Routes Visualization

For a better visualization of your vehicle routes open the **Settings Window** and select **Vehicle Routes Setup.** This will open the Vehicle Routes window.

<figure><img src="https://1500817731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuflU4iIzTBjoLH93zTYD%2Fuploads%2FrZcvdAjl0FNyqjyGDTr0%2Fimage_2024-02-07_175938969.png?alt=media&amp;token=c210a5cd-c913-47b8-9cdc-8e5eb97194f0" alt=""><figcaption><p>Vehicle Routes Window</p></figcaption></figure>

You can toggle the routes on/off for each vehicle type and select independent colors for each route for better visualization.

For the example above, using the Vehicle Routes Window, you can see that the Truck is no longer allowed on the second lane.&#x20;

<figure><img src="https://1500817731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuflU4iIzTBjoLH93zTYD%2Fuploads%2FssEcTRhZ0AD8f3IkRz8K%2Fv2-RouteVisualization.PNG?alt=media&amp;token=7352a398-312e-4209-a3f1-db2a84a16435" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
To see all the vehicle-type edited waypoints see the [Waypoint Setup Window](/mobile-traffic-system/setup-guide/waypoint-setup-window.md#show-vehicle-edited-waypoints)window.&#x20;
{% endhint %}

For a better understanding, watch the following video:

{% embed url="<https://youtu.be/JNVwL9hcodw?feature=shared>" %}
