Scripting/Client/Functions/ScreenPosToWorld

Two arguments: the world point on the ground plane (z = 0) under a screen pixel as {x, y, z}, or null for sky. Three arguments (v0.2.4+, original LU form): the point on that pixel's ray depth in front of the camera - depth 0 is the camera position, so ScreenPosToWorld(0, 0, 0) reads where the camera is. A VectorScreen can replace x, y.

Syntax

ScreenPosToWorld(x, y)
ScreenPosToWorld(x, y, depth)

Arguments

Example

function onScriptLoad()
{
	local pos = player.Pos;
	ScreenPosToWorld( pos.x, pos.y );
}

This sample was generated from the signature – adapt the values to your gamemode.

Section: Screen, world and camera

Categories: Client functions | Screen, world and camera