---
name: "screenToWorld"
type: command
status: ok
groups: ["Positions"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/screenToWorld
revid: 377892
updated: 2026-01-05T17:38:23Z
---

# screenToWorld

*Command · Positions · Arma 3 v0.50 · introduced in Arma 2 v1.00*

## Description

Returns the position on landscape ([PositionAGL](../topics/Position.md#positionagl)) corresponding to the given point on screen (in UI coordinates).

> [!NOTE]
> This command performs an intersection with the ground/water surface, from the camera position along the [screenToWorldDirection](../commands/screenToWorldDirection.md) vector up to `viewDistance` for terrain intersection and `2 * viewDistance` for water intersection. In other words, it is similar to doing:
>
> ```sqf
> private _p1 = AGLToASL positionCameraToWorld [0, 0, 0];                    // camera position ASL
> private _vector = screenToWorldDirection _screenPos;                    // "aim" vector
> private _p2 = _p1 vectorAdd (_vector vectorMultiply viewDistance * 2);    // the ray does not go beyond 2 * view distance
> ASLToAGL terrainIntersectAtASL [_p1, _p2]
> ```

## Syntax

### Syntax 1

```sqf
screenToWorld screen
```

**Parameters:**

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

**Returns:** [PositionAGL](../topics/Position.md#positionagl), world position on surface [x, y, 0]

### Syntax 2

*since arma3 2.18*

```sqf
camera screenToWorld position
```

**Parameters:**

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

**Returns:** [PositionAGL](../topics/Position.md#positionagl), world position on surface [x,y,0]

## Examples

### Example 1

```sqf
private _wPos = screenToWorld [0.5, 0.5];
```

### Example 2

```sqf
private _wPos = _myCamera screenToWorld [0.5, 0.5]; // since Arma 3 2.18
```

## See also

SafeZone · [worldToScreen](../commands/worldToScreen.md) · [screenToWorldDirection](../commands/screenToWorldDirection.md)

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