# VEHICLE::_SET_TRAIN_COLLISION_AVOIDANCE_ENABLED

- **Hash:** `0xE6BD7DD3FD474415`
- **Namespace:** VEHICLE
- **Runtime name (Lua/JS):** `SetTrainCollisionAvoidanceEnabled`
- **Side:** client (game native)
- **Name status:** community guess (may change)
- **Documentation:** described
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/VEHICLE/_SET_TRAIN_COLLISION_AVOIDANCE_ENABLED

## Signature

```c
void _SET_TRAIN_COLLISION_AVOIDANCE_ENABLED(Vehicle train, BOOL toggle);
```

## Parameters

- `train` (`Vehicle`)
- `toggle` (`BOOL`)

## Returns

`void`

## Description

*Source: alloc8or RDR3 NativeDB*

Enables or disables collision-avoidance behavior for AI-controlled trains.
When enabled, the train can automatically stop if an obstacle or possible collision is detected ahead on the track. When disabled, it continues moving without reacting to those obstacles.

*Source: VORPCORE RDR3natives*

Enables or disables collision avoidance behavior for AI-controlled trains.

When enabled, the train will automatically stop if an obstacle or possible
collision is detected ahead on the track. When disabled, the train will
continue moving without reacting to obstacles

## Usage

### Lua

```lua
SetTrainCollisionAvoidanceEnabled(train, toggle)

-- always available, by hash
Citizen.InvokeNative(0xE6BD7DD3FD474415, train, toggle)
```

### JavaScript

```js
SetTrainCollisionAvoidanceEnabled(train, toggle);

// by hash
Citizen.invokeNative('0xE6BD7DD3FD474415', train, toggle);
```

### C#

```csharp
Function.Call((Hash)0xE6BD7DD3FD474415, train, toggle);
```

- The name is a community guess and may change. If the named call is missing in your client build, use `InvokeNative` with the hash — it always works.

*Sources: alloc8or RDR3 NativeDB, VORPCORE RDR3natives.*
