{"name":"screenToWorldDirection","operator":null,"title":"screenToWorldDirection","type":"command","url":"https://community.bistudio.com/wiki/screenToWorldDirection","revid":378361,"updated":"2026-04-03T16:05:32Z","groups":["Positions"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"2.18"}],"since":{"game":"arma3","name":"Arma 3","version":"2.18"},"arma3_since":"2.18","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"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.","syntaxes":[{"syntax":"screenToWorldDirection screen","since":null,"effect":null,"exec":null,"params":[{"name":"screen","type":"Array","optional":false,"default":null,"description":"screen position [x,y] (see SafeZone for more info)","types":["Array"],"since":null,"text":"screen: Array - screen position [x,y] (see SafeZone for more info)"}],"returns":{"type":"Vector3D","types":["Vector3D"],"description":"world vector","text":"Vector3D - world vector"},"form":"unary","operator":null,"left":null,"right":{"text":"screen","types":["Array"]}},{"syntax":"camera screenToWorldDirection position","since":null,"effect":null,"exec":null,"params":[{"name":"camera","type":"Object","optional":false,"default":null,"description":"camera object","types":["Object"],"since":null,"text":"camera: Object - camera object"},{"name":"position","type":"Array","optional":false,"default":null,"description":"screen position [x,y] (see SafeZone for more info)","types":["Array"],"since":null,"text":"position: Array - screen position [x,y] (see SafeZone for more info)"}],"returns":{"type":"Vector3D","types":["Vector3D"],"description":"world vector","text":"Vector3D - world vector"},"form":"binary","operator":null,"left":{"text":"camera","types":["Object"]},"right":{"text":"position","types":["Array"]}}],"examples":[{"text":"```sqf\nprivate _vec = screenToWorldDirection [0.5, 0.5]; // a vector pointing to the front of the camera\n```","code":["private _vec = screenToWorldDirection [0.5, 0.5]; // a vector pointing to the front of the camera"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["SafeZone","worldToScreen","screenToWorld"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Positions","Introduced with Arma 3 version 2.18","Scripting Commands"]}