{"name":"doFollow","operator":null,"title":"doFollow","type":"command","url":"https://community.bistudio.com/wiki/doFollow","revid":353189,"updated":"2024-03-12T13:35:21Z","groups":["Unit Control"],"status":"ok","replaced_by":[],"games":[{"game":"ofp","name":"Operation Flashpoint","version":"1.00"},{"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":"ofp","name":"Operation Flashpoint","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":"local","effect":"global","server_exec":false},"exec":null,"description":"Order the given unit(s) to follow another from his own group as his formation leader (without radio messages).\n\nIt is also used to order the unit to **return to formation** after e.g doStop even if it is the leader himself that should return to formation (see Example 2).","syntaxes":[{"syntax":"unit doFollow unitLead","since":null,"effect":null,"exec":null,"params":[{"name":"unit","type":"Object or Array of Objects","optional":false,"default":null,"description":null,"types":["Object","Array"],"since":null,"text":"unit: Object or Array of Objects"},{"name":"unitLead","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"unitLead: Object"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"unit","types":["Object","Array"]},"right":{"text":"unitLead","types":["Object"]}}],"examples":[{"text":"```sqf\n_soldier1 doFollow _soldier2;\n```","code":["_soldier1 doFollow _soldier2;"]},{"text":"```sqf\nunits _group doFollow leader _group; // returns all the units to formation\n```","code":["units _group doFollow leader _group; // returns all the units to formation"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["doStop","doMove","commandFollow","formationLeader","formLeader","isFormationLeader","leader","selectLeader","setLeader"],"notes":[{"user":"Mojito69","date":"2010-10-11T18:00:00Z","text":"These commands (doFollow or commandFollow) work only if the two units are in the same group."},{"user":"BaerMitUmlaut","date":"2016-08-29T23:48:00Z","text":"The name of this command is a bit misleading, it is used to make a unit return to the formation of its group or subformation."},{"user":"Leopard20","date":"2022-02-17T12:25:29Z","text":"doFollow doesn't work with player-issued commands (those issued via the commanding menus). As a workaround, it is possible to use joinSilent instead, and join the unit into its current group:\n\n```sqf\n[_unit] joinSilent group _unit; // return to formation\n```\n\nNote that the group must have **at least 2 units**, and not all units should be joined at once, otherwise the group will temporarily become empty and all its waypoints **will be lost**!"}],"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 version 1.00","Operation Flashpoint: Elite: Scripting Commands","Operation Flashpoint: New Scripting Commands","Operation Flashpoint: Scripting Commands","Scripting Commands","Scripting Commands: Global Effect","Take On Helicopters: Scripting Commands"]}