# GuiInterface.compassAddIcon

Add an icon to the compass.

**Kind:** Function

**Environments:** Game

## Game

``` { .lua .api-signature }
guiInterface:compassAddIcon( iconName, image?, showDistance?, width?, height? )
```

[Open the full Game reference](../Game-Script-Environment/Userdata/GuiInterface.md#compassaddicon)

**Availability:** Client only

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `compassHud` | [GuiInterface](../Game-Script-Environment/Userdata/GuiInterface.md) | The compass hud GUI. |
| `iconName` | string | Name of the new compass icon. |
| `image` *(optional)* | string | The name or path of the image. (Optional) |
| `showDistance` *(optional)* | string | If the icon should display distance. (Optional) |
| `width` *(optional)* | string | The width of the icon, defaults to 22. (Optional) |
| `height` *(optional)* | string | The height of the icon, defaults to 22. (Optional) |
