> 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/complete-api/clearpathforspecialvehicles.md).

# ClearPathForSpecialVehicles

### Description

All traffic vehicles in the scene will decelerate and change lanes towards the edge of the road to create space for special vehicles such as police or ambulances. If this method is used for a long duration, the vehicles will gradually decelerate and eventually come to a stop.

### Declaration&#x20;

```csharp
public static void ClearPathForSpecialVehicles(bool active, RoadSide side)
```

### Parameters

<table><thead><tr><th width="188">Name</th><th>Description</th></tr></thead><tbody><tr><td><strong>active</strong></td><td>If true vehicle will drive on the side of the road.</td></tr><tr><td><strong>side</strong></td><td>Specifies the road side.</td></tr></tbody></table>

### Example

```csharp
using Gley.TrafficSystem;
using UnityEngine;

public class Test : MonoBehaviour
{
    //a reference to vehicle pool and player assigned in inspector
    public VehiclePool vehiclePool;
    public Transform player;
    void Start()
    {
        API.Initialize(player, 20, vehiclePool);
    }

    //called when a special vehicle is closed
    public void ClearPath()
    {
        API.ClearPathForSpecialVehicles(true, RoadSide.Right);
    }

    //resume normal driving
    public void DriveNormally()
    {
        API.ClearPathForSpecialVehicles(false, RoadSide.Right);
    }
}
```
