{"name":"formationPosition","title":"formationPosition","type":"command","url":"https://community.bistudio.com/wiki/formationPosition","revid":309288,"updated":"2022-05-05T01:47:09Z","groups":["Positions"],"status":"ok","games":{"arma1":"1.00","arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma1 1.00","arma3_since":"0.50","description":"Return position of unit in the formation.","syntaxes":[{"syntax":"formationPosition unit","params":[{"name":"unit","type":"Object","type_expr":"Object"}],"returns":{"type":"Position","type_expr":"Position"},"form":"unary","right":{"text":"unit"}}],"examples":[{"code":["_pos = formationPosition _unit;"]},{"text":"```sqf\n// Reposition entire group to a new position (ground level)\nprivate _group = group player;\nprivate _leader = leader _group;\n\n// Set the leader to the spawn position\n_leader setPosATL markerPos \"spawn_position\";\n\n// Reposition all units of the group except the leader\n{\n    private _formationPos = formationPosition _x;\n    _formationPos set [2, 0];\n    _x setPosATL _formationPos;\n} forEach (units _group - [_leader]);\n```","code":["// Reposition entire group to a new position (ground level)\nprivate _group = group player;\nprivate _leader = leader _group;\n\n// Set the leader to the spawn position\n_leader setPosATL markerPos \"spawn_position\";\n\n// Reposition all units of the group except the leader\n{\n\tprivate _formationPos = formationPosition _x;\n\t_formationPos set [2, 0];\n\t_x setPosATL _formationPos;\n} forEach (units _group - [_leader]);"]}],"see_also":["formation"]}