---
name: "assignedVehicle"
type: command
status: ok
groups: ["Object Manipulation"]
arma3_since: "0.50"
locality: {"argument": "local", "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/assignedVehicle
revid: 330331
updated: 2022-08-31T15:20:27Z
---

# assignedVehicle

*Command · Object Manipulation · Arma 3 v0.50 · introduced in Armed Assault v1.05*

Locality: arguments **local**

## Description

Returns the vehicle to which a unit is assigned, usually with *assignAsXXX* command. If no vehicle is assigned [objNull](../commands/objNull.md) is returned.

> [!NOTE]
> See AI Group Vehicle Management for more information.

## Syntax

```sqf
assignedVehicle unit
```

**Parameters:**

- `unit`: [Object](../topics/Object.md)

**Returns:** [Object](../topics/Object.md)

## Examples

### Example 1

```sqf
_vehicle = assignedVehicle player;
```

### Example 2

```sqf
_units apply { _x leaveVehicle (assignedVehicle _x) };
```

## See also

[assignedVehicleRole](../commands/assignedVehicleRole.md) · [addVehicle](../commands/addVehicle.md) · [assignAsDriver](../commands/assignAsDriver.md) · [assignAsCargo](../commands/assignAsCargo.md) · [assignAsCommander](../commands/assignAsCommander.md) · [assignAsGunner](../commands/assignAsGunner.md) · [assignAsTurret](../commands/assignAsTurret.md) · [assignAsCargoIndex](../commands/assignAsCargoIndex.md) · [unassignVehicle](../commands/unassignVehicle.md) · [leaveVehicle](../commands/leaveVehicle.md) · [assignedVehicles](../commands/assignedVehicles.md) · [assignedGroup](../commands/assignedGroup.md) · [fullCrew](../commands/fullCrew.md)

<sub>Source: [BI Community Wiki — assignedVehicle](https://community.bistudio.com/wiki/assignedVehicle) (revision 330331).</sub>
