> 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/create-a-road.md).

# Create a Road

Mobile Traffic System uses a road and lane drawing system to help you draw the paths for the vehicles. This road and lane information is used just inside Unity Editor, at runtime only the generated waypoint information is used.

To draw a road open the **Settings Window** and select **Road Setup -> Create Road**

<figure><img src="https://1500817731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuflU4iIzTBjoLH93zTYD%2Fuploads%2FoBC9pxru2sYjtZV1mBEB%2Fimage_2024-02-09_130430990.png?alt=media&amp;token=fd9a140e-5952-42f2-9f5b-ea200dd0d92b" alt=""><figcaption></figcaption></figure>

Press **SHIFT+ Left Click** to add a road point. When you click the second time, a line will be drawn between those two points. You can adjust the curvature of the line by moving the anchor points (the small white ones) or change the position of the line by moving the control points (the red ones). Using this method, you can draw a curve to the center of your road.

If you press **SHIFT+ Left Click** between two existing anchor points on the line, a new anchor point will be added at that spot.

If you press **SHIFT + Right Click** on an anchor point, that anchor point will be removed.

The **Edit Road Window** will automatically open when you start to draw a road.

<figure><img src="https://1500817731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuflU4iIzTBjoLH93zTYD%2Fuploads%2FuQ30lqVg5Rvgm6dYV1Gk%2Fimage_2024-02-09_130942209.png?alt=media&amp;token=1140b99a-3828-4dec-87a8-8f0eebc0e1de" alt=""><figcaption></figcaption></figure>

The **Edit Road Window** allows you to customize your road.

**Nr Of Lanes** - Represents the number of lanes your road will have.

**Lane Width** - Represents how wide each lane should be. It's best practice to generate the waypoints in the middle of each lane.

**Waypoint Distance** - Represents the spacing between two consecutive waypoints.

The global lane settings are applied to all lanes of the road. You can set the maximum speed and the types of vehicles allowed on all lanes.

By using **Apply Global Car Settings**, the car setup will be applied to all lanes, and by using **Apply Speed**, the speed settings will be applied to all lanes.

**Apply All Settings** will apply both car and speed settings to all lanes of this road.

Individual lane settings allow you to apply different settings to each lane. You can change the direction of a lane using the **->** and **<-** buttons.

When all setup is done, press the **Generate Waypoints** button. This will automatically generate and connect the waypoints for each lane. These waypoints are used by the traffic vehicles to drive on.

<figure><img src="https://1500817731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuflU4iIzTBjoLH93zTYD%2Fuploads%2FDEp71aDpeVJkd9ylU7NJ%2Fimage_2024-02-09_131116597.png?alt=media&amp;token=8e00b1ea-cd70-4323-bcc7-74790169c938" alt=""><figcaption></figcaption></figure>

The **Link Other Lanes** button creates connections to other lanes that vehicles can use to overtake each other. Vehicles will only overtake on these other lane connections.

The **Link Distance** represents how far away the other lane waypoint should be. For example, if set to 1, the link will connect to the first waypoint in front of the current lane one as below.

<figure><img src="https://1500817731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuflU4iIzTBjoLH93zTYD%2Fuploads%2F2KTZh1f1ajPX0FXtdMd5%2Fimage_2024-02-09_131703500.png?alt=media&amp;token=3e934fc4-a70b-4871-8682-177363ad281b" alt=""><figcaption></figcaption></figure>

If set to 3, it will link 3 waypoints ahead on the other lane as below.

<figure><img src="https://1500817731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuflU4iIzTBjoLH93zTYD%2Fuploads%2FyWzIzzrX04J3RyyGcSvI%2Fimage_2024-02-09_132003103.png?alt=media&amp;token=76c3fc4a-f525-43ef-b424-c3c1a4f384fc" alt=""><figcaption></figcaption></figure>

When you finish editing a road, press the **Back** button.

To edit a road, open the **Road Setup -> View Roads**

Scroll through the scene window until you find the desired road, then click **Select** in the list. This action opens the **Edit Road** window, where you can adjust road settings or continue drawing the road further.

If a road is no longer needed, press the **Delete** button. Alternatively, you can locate a road by using the **View** button.

<figure><img src="https://1500817731-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuflU4iIzTBjoLH93zTYD%2Fuploads%2FwQn9woAx4PmJo2Wejkrl%2Fimage_2024-02-09_132221413.png?alt=media&amp;token=8a10ec02-e292-475b-a2e1-0c6dcffc730f" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Before entering play mode, ensure to press **Apply Settings**. If you've made modifications to your road network, pressing **Apply Settings** is necessary to ensure that the changes are applied in runtime mode.
{% endhint %}

This tutorial was made for the old version of the plugin, but all information from it is still valid and it should be watched for a better understanding.

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