# getWorldFromScreenPosition (Client)

> Turns a screen point, at a depth, into a world point, with the current frame's camera.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: World and weather
- **URL**: https://wiki.mymp.gg/en/getWorldFromScreenPosition

## Syntax

```lua
vec3 getWorldFromScreenPosition(float x, y, depth)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `x, y, depth` | `float` | The screen coordinates in pixels and the distance from the camera along its view direction, in metres. A `vec3` also works. |

## Returns

The point in the world.

## Example

```lua
local sx, sy = getScreenSize()
local ahead = getWorldFromScreenPosition(sx / 2, sy / 2, 50)
outputDebugString(("50 m ahead: %.1f, %.1f, %.1f"):format(ahead.x, ahead.y, ahead.z))
```

## See also

- [getScreenFromWorldPosition (Client)](https://wiki.mymp.gg/en/getScreenFromWorldPosition.md): Projects a world point onto the screen, with the current frame's camera.
- [getCursorPosition (Client)](https://wiki.mymp.gg/en/getCursorPosition.md): Reads where the cursor is on the screen and the world point it points at.
- [processLineOfSight (Client)](https://wiki.mymp.gg/en/processLineOfSight.md): Casts a ray between two points and returns the first thing it hits.
