{"name":"doFollow","title":"doFollow","type":"command","url":"https://community.bistudio.com/wiki/doFollow","revid":353189,"updated":"2024-03-12T13:35:21Z","groups":["Unit Control"],"status":"ok","games":{"ofp":"1.00","ofpe":"1.00","arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"ofp 1.00","arma3_since":"0.50","locality":{"argument":"local","effect":"global"},"description":"Order the given unit(s) to follow another from his own group as his formation leader (without radio messages).\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","params":[{"name":"unit","type":"Object or Array of Objects","type_expr":"Object | Array<Object>"},{"name":"unitLead","type":"Object","type_expr":"Object"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"unit"},"right":{"text":"unitLead"}}],"examples":[{"code":["_soldier1 doFollow _soldier2;"]},{"code":["units _group doFollow leader _group; // returns all the units to formation"]}],"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**!"}]}