{"name":"BIS_fnc_scriptedMove","operator":null,"title":"BIS fnc scriptedMove","type":"function","url":"https://community.bistudio.com/wiki/BIS_fnc_scriptedMove","revid":347664,"updated":"2023-10-08T19:35:39Z","groups":["Object Manipulation"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"2.10"}],"since":{"game":"arma3","name":"Arma 3","version":"2.10"},"arma3_since":"2.10","branch":null,"locality":{"argument":"global","effect":"global","server_exec":false},"exec":null,"description":"Forces a unit to turn towards and walk to provided destination(s). Will not work on player. When Group is used as argument, the function will be automatically executed for each unit in the group.\n\n> [!NOTE]\n> When using *endAnim*, make sure it is able to break *walkAnim* (not all animations are compatible). When code is executed, it receives the following params: [unit, waypoints, currentIndex, userArgs].","syntaxes":[{"syntax":"[unitOrGroup, waypoints, code, walkAnim, completionRadius, endAnim] call BIS_fnc_scriptedMove","since":null,"effect":null,"exec":null,"params":[{"name":"unitOrGroup","type":"Object or Group","optional":false,"default":null,"description":"unit or group of units of the class \"Man\"","types":["Object","Group"],"since":null,"text":"unitOrGroup: Object or Group - unit or group of units of the class \"Man\""},{"name":"waypoints","type":null,"optional":false,"default":null,"description":"Array of Positions in format [pos1, pos2, ...] or [[pos1, completionRadius1, turnSpeedCoef1], [pos2, completionRadius2, turnSpeedCoef2], ...]","types":["Array","Position"],"since":null,"text":"waypoints: Array of Positions in format [pos1, pos2, ...] or [[pos1, completionRadius1, turnSpeedCoef1], [pos2, completionRadius2, turnSpeedCoef2], ...]"},{"name":"code","type":"Code or Array","optional":true,"default":"`{}`","description":"code to run after each waypoint completion. Format {code} or [[params], {code}]","types":["Code","Array"],"since":null,"text":"code: Code or Array - (Optional, default `{}`) code to run after each waypoint completion. Format {code} or [[params], {code}]"},{"name":"walkAnim","type":"String","optional":true,"default":"\"AmovPercMwlkSnonWnonDf\"","description":"walking animation to be played in a loop","types":["String"],"since":null,"text":"walkAnim: String - (Optional, default \"AmovPercMwlkSnonWnonDf\") walking animation to be played in a loop"},{"name":"completionRadius","type":"Number","optional":true,"default":"0.5","description":"how far from waypoint center to consider waypoint completion. Global value. The completionRadius given with individual waypoint position overrides global value","types":["Number"],"since":null,"text":"completionRadius: Number - (Optional, default 0.5) how far from waypoint center to consider waypoint completion. Global value. The completionRadius given with individual waypoint position overrides global value"},{"name":"turnSpeedCoef","type":"Number","optional":true,"default":"1.0","description":"how quickly the unit turns towards next waypoint (fast 0.1 ... 10 slow). The turnSpeedCoef given with individual waypoint position overrides global value","types":["Number"],"since":null,"text":"turnSpeedCoef: Number - (Optional, default 1.0) how quickly the unit turns towards next waypoint (fast 0.1 ... 10 slow). The turnSpeedCoef given with individual waypoint position overrides global value"},{"name":"endAnim","type":"Number","optional":true,"default":"animationState of the unit prior to function execution","description":"when unit reaches last point, this is the animation to be played immediately. Use \"\" to let last walkAnim run in full","types":["Number"],"since":null,"text":"endAnim: Number - (Optional, default animationState of the unit prior to function execution) when unit reaches last point, this is the animation to be played immediately. Use \"\" to let last walkAnim run in full"}],"returns":{"type":"Script Handle or String or Nothing","types":["Script Handle","String","Nothing"],"description":"depends on execution (local/remote/error);","text":"Script Handle or String or Nothing - depends on execution (local/remote/error);"}}],"examples":[{"text":"```sqf\n[myUnit, [getMarkerPos \"wp1\", getMarkerPos \"wp2\", getMarkerPos \"wp3\"]] call BIS_fnc_scriptedMove;\n```","code":["[myUnit, [getMarkerPos \"wp1\", getMarkerPos \"wp2\", getMarkerPos \"wp3\"]] call BIS_fnc_scriptedMove;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["move","setDriveOnPath","BIS_fnc_unitCapture"],"notes":[],"categories":["Arma 3: Functions","Arma 3: New Functions","Function Group: Object Manipulation","Functions","Functions: Global Effect","Introduced with Arma 3 version 2.10"],"docblock":null,"filled_from_docblock":[]}