---
name: "setName"
type: command
status: ok
groups: ["Unit Identity", "Locations"]
arma3_since: "0.50"
locality: {"argument": "global", "effect": "local", "server_exec": false}
source: https://community.bistudio.com/wiki/setName
revid: 370891
updated: 2025-02-21T10:44:05Z
---

# setName

*Command · Unit Identity, Locations · Arma 3 v0.50 · introduced in Armed Assault v1.08*

Locality: arguments **global** · effect **local**

## Description

Sets the name of a location or a person (person only in single player).

## Syntax

### Syntax 1

```sqf
thing setName name
```

**Parameters:**

- `thing`: [Location](../topics/Location.md) or Arma 3 v1.02 [Object](../topics/Object.md)
- `name`: [String](../topics/String.md)

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

### Syntax 2

*since arma3 1.02*

```sqf
unit setName [name, firstName, lastName]
```

**Parameters:**

- `unit`: [Object](../topics/Object.md)
- `name`: [String](../topics/String.md)
- `firstName`: [String](../topics/String.md)
- `lastName`: [String](../topics/String.md)

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

## Examples

### Example 1

```sqf
myLocation setName "My Location Name";
```

### Example 2

```sqf
player setName "New Name";
```

### Example 3

```sqf
player setName ["Ben Kerry","Ben","Kerry"];
```

## See also

[name](../commands/name.md) · [nameSound](../commands/nameSound.md) · [setNameSound](../commands/setNameSound.md) · [setIdentity](../commands/setIdentity.md)

## Community notes

**Pierre MGI** — 2014-08-18

Only last name will appear in command bar i.e. `this setName _myNameArray` will display `_myNameArray select 2`.
If [setName](../commands/setName.md) is used with a string e.g `this setName "blah"`, nothing occurs in the command bar and the default randomized name is displayed.

Dealing with the units' names in a script, _x (in a `forEach units _group`, for example) will return the "object" as `B ALFA 4-1:2` or the name written in ai unit name field in editor (if exists).
This context is rather a "variable name" for each object (ai) than an "identity name" as given via the [setName](../commands/setName.md) command.

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