---
name: "name"
type: command
status: ok
groups: ["Unit Identity", "Locations"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/name
revid: 373980
updated: 2025-07-10T15:43:22Z
---

# name

*Command · Unit Identity, Locations · Arma 3 v0.50 · introduced in Operation Flashpoint v1.00*

## Description

When argument is [Object](../topics/Object.md), the command returns the name given to a unit using the [setIdentity](../commands/setIdentity.md) instruction or selected randomly by the game engine if [setIdentity](../commands/setIdentity.md) has not been used on the unit.
If used on vehicle, name of first crew member (in order commander, driver, gunner). If used on an object, "Error: No unit" is being returned.

## Syntax

### Syntax 1

```sqf
name object
```

**Parameters:**

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

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

### Syntax 2

*since arma1 1.08*

```sqf
name location
```

**Parameters:**

- `location`: [Location](../topics/Location.md)

**Returns:** [String](../topics/String.md) - the location's *name*. To get its textual value, use [text](../commands/text.md) (see [#Example 3](../commands/name.md#example-3))

### Syntax 3

*since arma3 2.18*

```sqf
name namespace
```

**Parameters:**

- `namespace`: [Namespace](../topics/Namespace.md)

**Returns:** [String](../topics/String.md) - namespace's *name*. Possible values:

- "mission" - for [missionNamespace](../commands/missionNamespace.md)
- "profile" - for [profileNamespace](../commands/profileNamespace.md)
- "ui" - for [uiNamespace](../commands/uiNamespace.md)
- "parsing" - for [parsingNamespace](../commands/parsingNamespace.md)
- "local" - for [localNamespace](../commands/localNamespace.md)
- "missionprofile" - for [missionProfileNamespace](../commands/missionProfileNamespace.md)
- "server" - for [serverNamespace](../commands/serverNamespace.md)
- "" - for some unnamed namespaces like temporary or server config for example.
- "null" - null namespace (this should never happen)

### Syntax 4

*since arma3 2.22*

```sqf
name scriptHandle
```

**Parameters:**

- `scriptHandle`: [Script Handle](../topics/Script_Handle.md)

**Returns:** [String](../topics/String.md) - The name given to the script via [scriptName](../commands/scriptName.md) or the name passed to [spawn](../commands/spawn.md) when creating a ["Empty Handle"](../topics/Script_Handle.md#promise_handles)

## Examples

### Example 1

```sqf
_name = name player;
```

### Example 2

```sqf
_locationName = name myLocation;
```

### Example 3

```sqf
name nearestLocation [position player, "Hill"]; // ""
text nearestLocation [position player, "Hill"]; // "Lesnoy Khrebet"
```

### Example 4

```sqf
_currentNamespace = name currentNamespace;
```

## Multiplayer

[name](../commands/name.md) returns [profileName](../commands/profileName.md), eventually suffixed by the server in the event of identical names, e.g `username`/`username (2)`.

## Problems

> [!IMPORTANT]
> If the provided unit is dead and has been removed from its group, its identity has then been purged to save memory and using [name](../commands/name.md) on it will result in a logged error.

## See also

[profileName](../commands/profileName.md) · [setName](../commands/setName.md) · [setIdentity](../commands/setIdentity.md) · [nameSound](../commands/nameSound.md) · [setNameSound](../commands/setNameSound.md) · [createLocation](../commands/createLocation.md) · [deleteLocation](../commands/deleteLocation.md) · [locationPosition](../commands/locationPosition.md) · [nearestLocation](../commands/nearestLocation.md) · [nearestLocations](../commands/nearestLocations.md) · [nearestLocationWithDubbing](../commands/nearestLocationWithDubbing.md)

## Community notes

**Kju** — 2017-01-30

[Location](../topics/Location.md) variant appears to be only for the 3d editor.

---

**Alef** — 2009-04-14

Will return `Error: No vehicle` for [JIP](../topics/Multiplayer_Scripting.md#join-in-progress) players in [init.sqf](../topics/Event_Scripts.md), if no [sleep](../commands/sleep.md) were performed.

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