{"name":"getAimDirectionAndUp","operator":null,"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","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"2.22"}],"since":{"game":"arma3","name":"Arma 3","version":"2.22"},"arma3_since":"2.22","branch":null,"locality":{"argument":"global","effect":null,"server_exec":false},"exec":null,"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]","since":null,"effect":null,"exec":null,"params":[{"name":"soldier","type":"Object","optional":false,"default":null,"description":"The soldier entity. The soldier must either be on foot or in a turret.","types":["Object"],"since":null,"text":"soldier: Object - The soldier entity. The soldier must either be on foot or in a turret."},{"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)","types":["Boolean"],"since":null,"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","types":["Array"],"description":"in format [directionForward, directionUp] in soldier's model space","text":"Array - in format [directionForward, directionUp] in soldier's model space"},"form":"unary","operator":null,"left":null,"right":{"text":"[soldier, isRenderScope]","types":["Array"]}}],"examples":[{"text":"```sqf\nonEachFrame\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}\n```","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}"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["weaponDirection","eyeDirection","positionCameraToWorld","eyePos"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Object Manipulation","Command Group: Render Time Scope","Introduced with Arma 3 version 2.22","Scripting Commands"]}