---
name: "vehicleVarName"
type: command
status: ok
groups: ["Object Manipulation"]
arma3_since: "0.50"
locality: {"argument": "global", "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/vehicleVarName
revid: 352868
updated: 2024-02-28T19:33:35Z
---

# vehicleVarName

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

Locality: arguments **global**

## Description

Returns the variable name that contains a primary editor reference to this object. This is the variable given in the *Insert Unit dialog / name field* in the editor. It can be changed using [setVehicleVarName](../commands/setVehicleVarName.md).

> [!NOTE]
> Respawned unit will have the same vehicleVarName as the corpse left behind, however actual [missionNamespace](../commands/missionNamespace.md) variable of the same name will only contain respawned unit.

## Syntax

```sqf
vehicleVarName object
```

**Parameters:**

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

**Returns:** [String](../topics/String.md) - variable name, if none was set, an empty string is returned

## Examples

### Example 1

```sqf
hint vehicleVarName player;
```

## See also

[setVehicleVarName](../commands/setVehicleVarName.md) · [BIS_fnc_objectVar](../functions/BIS_fnc_objectVar.md)

## Community notes

**Killzone_Kid** — 2015-04-19

To get variable names referencing an object in mission namespace:

```sqf
KK_fnc_objectVarNames = {
    private "_names";
    _names = [];
    {
        if (missionNamespace getVariable _x isEqualTo _this) then {
            _names pushBack _x;
        };
    } forEach allVariables missionNamespace;
    _names
};

// Example
myGroup = group player;
aGroup = group player;
hint str (group player call KK_fnc_objectVarNames); // ["agroup", "mygroup"]
```

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