{"name":"getAimDirectionAndUp","title":"getAimDirectionAndUp","type":"command","url":"https://community.bistudio.com/wiki/getAimDirectionAndUp","revid":378285,"updated":"2026-03-31T10:14:52Z","groups":["Object Manipulation","Render Time Scope"],"status":"ok","games":{"arma3":"2.22"},"since":"arma3 2.22","arma3_since":"2.22","locality":{"argument":"global"},"description":"Returns the aim direction and up vectors of a soldier in model space. It returns where the weapon aim is wanted from the eyePos, not the actual weapon direction. For actual weapon direction, see weaponDirection.","syntaxes":[{"syntax":"getAimDirectionAndUp [soldier, isRenderScope]","params":[{"name":"soldier","type":"Object","description":"The soldier entity. The soldier must either be on foot or in a turret.","type_expr":"Object"},{"name":"isRenderScope","type":"Boolean","optional":true,"default":"false","description":"Whether to use render scope to get the vector. (render scope is smoother for visualizing the vector in 3D)","type_expr":"Boolean","text":"isRenderScope: Boolean - (Optional, default false) Whether to use render scope to get the vector. (render scope is smoother for visualizing the vector in 3D)"}],"returns":{"type":"Array","type_expr":"Array","description":"in format [directionForward, directionUp] in soldier's model space"},"form":"unary","right":{"text":"[soldier, isRenderScope]"}}],"examples":[{"code":["onEachFrame\n{\n    getAimDirectionAndUp [player] params [\"_dir\", \"_up\"];\n    private _dirWS = player vectorModelToWorld _dir;\n    private _upWS = player vectorModelToWorld _up;\n    private _eyePos = eyePos player;\n    drawLine3D [ASLtoAGL _eyePos, ASLtoAGL (_eyePos vectorAdd _dirWS), [1,0,0,1]];\n}"]}],"see_also":["weaponDirection","eyeDirection","positionCameraToWorld","eyePos"]}