{"name":"formationPosition","operator":null,"title":"formationPosition","type":"command","url":"https://community.bistudio.com/wiki/formationPosition","revid":309288,"updated":"2022-05-05T01:47:09Z","groups":["Positions"],"status":"ok","replaced_by":[],"games":[{"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":"arma1","name":"Armed Assault","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Return position of unit in the formation.","syntaxes":[{"syntax":"formationPosition unit","since":null,"effect":null,"exec":null,"params":[{"name":"unit","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"unit: Object"}],"returns":{"type":"Position","types":["Position"],"description":null,"text":"Position"},"form":"unary","operator":null,"left":null,"right":{"text":"unit","types":["Object"]}}],"examples":[{"text":"```sqf\n_pos = formationPosition _unit;\n```","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]);"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["formation"],"notes":[],"categories":["ArmA: Armed Assault: New Scripting Commands","ArmA: Armed Assault: Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Positions","Introduced with Armed Assault version 1.00","Scripting Commands","Take On Helicopters: Scripting Commands"]}