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

# RemoveDrivingAction

### Description

Remove a specific [DriveActions](/mobile-traffic-system/complete-api/driveactions.md) action from a vehicle.

### Declaration&#x20;

```csharp
public static void RemoveDrivingAction(int vehicleIndex, DriveActions action)
```

### 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.</td></tr><tr><td><strong>action</strong></td><td>Action to remove.</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);
    }

    private void Update()
    {
        if(Input.GetKeyDown(KeyCode.Alpha1))
        {
            //if 1 is pressed the vehicle will stop
            API.AddDrivingAction(0, DriveActions.Stop, true);
        }

        if(Input.GetKeyDown(KeyCode.Alpha2))
        {
            // if 2 is pressed the vehicle will continue its previous behavior.
            API.RemoveDrivingAction(0, DriveActions.Stop);
        }
    }
}

```
