---
name: "drawLine3D"
type: command
status: ok
groups: ["Interaction"]
arma3_since: "0.50"
locality: {"argument": null, "effect": "local", "server_exec": false}
source: https://community.bistudio.com/wiki/drawLine3D
revid: 377395
updated: 2026-01-02T06:44:42Z
---

# drawLine3D

*Command · Interaction · Arma 3 v0.50*

Locality: effect **local**

## Description

Draws a line of a given colour between two 3D positions in the current frame. To be used mostly in a ["Draw3D"](../topics/Mission_Event_Handlers.md#draw3d) [mission event handler](../commands/addMissionEventHandler.md).

## Syntax

```sqf
drawLine3D [start, end, color, width]
```

**Parameters:**

- `start`: [PositionAGL](../topics/Position.md#positionagl)
- `end`: [PositionAGL](../topics/Position.md#positionagl)
- `color`: [Color (RGBA)](../topics/Color.md)
- `width`: [Number](../topics/Number.md) - (Optional, default 3) *(since arma3 2.18)*

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

## Examples

### Example 1

```sqf
onEachFrame {
    drawLine3D [getPos player, getPos cursorTarget, [1,1,1,1]];
};
```

## See also

[drawIcon3D](../commands/drawIcon3D.md) · [ASLToAGL](../commands/ASLToAGL.md)

## Community notes

**Killzone_Kid** — 2013-08-31

As the command syntax indicates, this command expects starting and ending position in format [PositionAGL](../topics/Position.md#positionagl) meaning that over the land it expects [PositionATL](../topics/Position.md#positionatl) and over the sea [PositionASLW](../topics/Position.md#positionaslw). Use additional [ASLToAGL](../commands/ASLToAGL.md) and [AGLToASL](../commands/AGLToASL.md) commands wherever is necessary.

```sqf
addMissionEventHandler ["Draw3D", {
    drawLine3D [ASLToAGL eyePos soldier1, ASLToAGL eyePos soldier2, [1,0,0,1]];
}];
```

---

**Waffle SS.** — 2015-02-18

Visible through fog and past draw distance.

---

**fusselwurm** — 2021-11-25

Caveat: lines invisible through MH-9 helicopter windows, see https://feedback.bistudio.com/T66225

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