{"name":"screenToWorldDirection","title":"screenToWorldDirection","type":"command","url":"https://community.bistudio.com/wiki/screenToWorldDirection","revid":378361,"updated":"2026-04-03T16:05:32Z","groups":["Positions"],"status":"ok","games":{"arma3":"2.18"},"since":"arma3 2.18","arma3_since":"2.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.","syntaxes":[{"syntax":"screenToWorldDirection screen","params":[{"name":"screen","type":"Array","description":"screen position [x,y] (see SafeZone for more info)","type_expr":"Array"}],"returns":{"type":"Vector3D","type_expr":"Vector3D","description":"world vector"},"form":"unary","right":{"text":"screen"}},{"syntax":"camera screenToWorldDirection position","params":[{"name":"camera","type":"Object","description":"camera object","type_expr":"Object"},{"name":"position","type":"Array","description":"screen position [x,y] (see SafeZone for more info)","type_expr":"Array"}],"returns":{"type":"Vector3D","type_expr":"Vector3D","description":"world vector"},"form":"binary","left":{"text":"camera"},"right":{"text":"position"}}],"examples":[{"code":["private _vec = screenToWorldDirection [0.5, 0.5]; // a vector pointing to the front of the camera"]}],"see_also":["SafeZone","worldToScreen","screenToWorld"]}