{"name":"lookAt","title":"lookAt","type":"command","url":"https://community.bistudio.com/wiki/lookAt","revid":369219,"updated":"2024-09-03T10:34:54Z","groups":["Unit Control"],"status":"ok","games":{"ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofpe 1.00","arma3_since":"0.50","description":"Control what the unit(s) is/are looking at (target or Position). If target is used, it will get revealed fully.","syntaxes":[{"syntax":"unit(s) lookAt position","params":[{"name":"unit(s)","type":"Object or Array of Objects","type_expr":"Object | Array<Object>"},{"name":"position","type":"Object or PositionAGL","type_expr":"Object | PositionAGL"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"unit(s)"},"right":{"text":"position"}}],"examples":[{"code":["_someSoldier lookAt _otherSoldier;"]},{"code":["[_someSoldier, _otherSoldier] lookAt markerPos \"markerOne\";"]},{"text":"```sqf\nhint \"R U N !\";\nBFG = \"B_AAA_System_01_F\" createVehicle position player;\ncreateVehicleCrew BFG;\nt = time + 10;\nonEachFrame\n{\n    BFG lookAt (unitAimPosition player vectorAdd (velocity player vectorMultiply 0.2));\n    if (time > t && alive player) then\n    {\n        [BFG,\"weapon_Cannon_Phalanx\",[0]] call BIS_fnc_fire;\n    };\n};\n```","code":["hint \"R U N !\";\nBFG = \"B_AAA_System_01_F\" createVehicle position player;\ncreateVehicleCrew BFG;\nt = time + 10;\nonEachFrame\n{\n\tBFG lookAt (unitAimPosition player vectorAdd (velocity player vectorMultiply 0.2));\n\tif (time > t && alive player) then\n\t{\n\t\t[BFG,\"weapon_Cannon_Phalanx\",[0]] call BIS_fnc_fire;\n\t};\n};"]}],"see_also":["glanceAt","commandWatch","doWatch","freeLook"]}