---
name: "screenToWorldDirection"
type: command
status: ok
groups: ["Positions"]
arma3_since: "2.18"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/screenToWorldDirection
revid: 378361
updated: 2026-04-03T16:05:32Z
---

# screenToWorldDirection

*Command · Positions · Arma 3 v2.18*

## Description

Returns the 3D vector in world corresponding to the given point on the screen (in UI coordinates), as if the vector was aiming from the camera to the screen position.

## Syntax

### Syntax 1

```sqf
screenToWorldDirection screen
```

**Parameters:**

- `screen`: [Array](../topics/Array.md) - screen position [x,y] (see [SafeZone](../topics/SafeZone.md) for more info)

**Returns:** [Vector3D](../topics/Vector3D.md) - world vector

### Syntax 2

```sqf
camera screenToWorldDirection position
```

**Parameters:**

- `camera`: [Object](../topics/Object.md) - camera object
- `position`: [Array](../topics/Array.md) - screen position [x,y] (see [SafeZone](../topics/SafeZone.md) for more info)

**Returns:** [Vector3D](../topics/Vector3D.md) - world vector

## Examples

### Example 1

```sqf
private _vec = screenToWorldDirection [0.5, 0.5]; // a vector pointing to the front of the camera
```

## See also

[SafeZone](../topics/SafeZone.md) · [worldToScreen](../commands/worldToScreen.md) · [screenToWorld](../commands/screenToWorld.md)

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