> 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/removevehiclecontrol.md).

# RemoveVehicleControl

### Description

Completely remove a vehicle from the Traffic System. Scripts will no longer interact with the vehicle sent as parameter.

### Declaration&#x20;

```csharp
public static void RemoveVehicleControl(int vehicleIndex)
```

### Parameters

<table><thead><tr><th width="188">Name</th><th>Description</th></tr></thead><tbody><tr><td><strong>vehicleIndex</strong></td><td>The index of the vehicle to be removed.</td></tr></tbody></table>

### Example

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

public class Test : MonoBehaviour
{
    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.Alpha0))
        {
            API.RemoveVehicleControl(0);
        }
        if (Input.GetKeyDown(KeyCode.Alpha1))
        {
            API.AddVehicleControl(0);
        }
    }
}

```
