{"name":"aimedAtTarget","title":"aimedAtTarget","type":"command","url":"https://community.bistudio.com/wiki/aimedAtTarget","revid":363498,"updated":"2024-04-01T11:17:25Z","groups":["Object Manipulation","Weapons"],"status":"ok","games":{"arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma2oa 1.50","arma3_since":"0.50","description":"Returns how good a vehicle's weapon is aimed at the target.","syntaxes":[{"syntax":"vehicle aimedAtTarget [target, weapon]","params":[{"name":"vehicle","type":"Object","description":"vehicle only, not unit","type_expr":"Object"},{"name":"target","type":"Object","type_expr":"Object"},{"name":"weapon","type":"String","optional":true,"description":"if not provided, checks all weapons; if provided, checks that weapon only","type_expr":"String","text":"weapon: String - (Optional) if not provided, checks all weapons; if provided, checks that weapon only"}],"returns":{"type":"Number in range 0..1","type_expr":"Number","description":"0 if no weapons or if weapon was provided and not found","text":"Number in range 0..1 - 0 if no weapons or if *weapon* was provided and not found"},"form":"binary","left":{"text":"vehicle"},"right":{"text":"[target, weapon]"}}],"examples":[{"code":["_aimingQuality = heli aimedAtTarget [target];"]},{"code":["_aimingQuality = heli aimedAtTarget [target, \"M197\"];"]}],"see_also":["fireAtTarget"],"notes":[{"user":"Killzone_Kid","date":"2013-11-19T15:02:00Z","text":"The command doesn't work with soldier weapons, only vehicle weapons (in Arma 3 at least). The return value is either 1 or 0, very rarely the value falls in between.\n1 doesn't mean you are going to hit the target, while 0 means you're definitely off."}]}