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

# RemoveVehicle

### Description

Remove a specific vehicle from the scene bypassing the remove conditions of the Traffic System.

The removed vehicle will be instantiated again when requested by the Traffic System.

### Declaration&#x20;

```csharp
public static void RemoveVehicle(GameObject vehicle)

public static void RemoveVehicle(int vehicleIndex)
```

### Parameters

<table><thead><tr><th width="188">Name</th><th>Description</th></tr></thead><tbody><tr><td><strong>vehicle</strong></td><td>The root gameobject of the vehicle to be removed from the scene.</td></tr><tr><td><strong>vehicleIndex</strong></td><td>The index of the vehicle to be removed from the scene.</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);
    }

    public void RemoveVehicle()
    {
        API.RemoveVehicle(GameObject.Find("Sedan(Clone)0"));
    }
}

```
