{"name":"lookAt","operator":null,"title":"lookAt","type":"command","url":"https://community.bistudio.com/wiki/lookAt","revid":369219,"updated":"2024-09-03T10:34:54Z","groups":["Unit Control"],"status":"ok","replaced_by":[],"games":[{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},{"game":"arma1","name":"Armed Assault","version":"1.00"},{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"ofpe","name":"Operation Flashpoint: Elite","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"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","since":null,"effect":null,"exec":null,"params":[{"name":"unit(s)","type":"Object or Array of Objects","optional":false,"default":null,"description":null,"types":["Object","Array"],"since":null,"text":"unit(s): Object or Array of Objects"},{"name":"position","type":"Object or PositionAGL","optional":false,"default":null,"description":null,"types":["Object","PositionAGL"],"since":null,"text":"position: Object or PositionAGL"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"unit(s)","types":["Object","Array"]},"right":{"text":"position","types":["Object","PositionAGL"]}}],"examples":[{"text":"```sqf\n_someSoldier lookAt _otherSoldier;\n```","code":["_someSoldier lookAt _otherSoldier;"]},{"text":"```sqf\n[_someSoldier, _otherSoldier] lookAt markerPos \"markerOne\";\n```","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};"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["glanceAt","commandWatch","doWatch","freeLook"],"notes":[],"categories":["ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Unit Control","Introduced with Operation Flashpoint: Elite version 1.00","Operation Flashpoint: Elite: New Scripting Commands","Operation Flashpoint: Elite: Scripting Commands","Scripting Commands","Take On Helicopters: Scripting Commands"]}