---
name: "BIS_fnc_scriptedMove"
type: function
status: ok
groups: ["Object Manipulation"]
arma3_since: "2.10"
locality: {"argument": "global", "effect": "global", "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_scriptedMove
revid: 347664
updated: 2023-10-08T19:35:39Z
---

# BIS_fnc_scriptedMove

*Function · Object Manipulation · Arma 3 v2.10*

Locality: arguments **global** · effect **global**

## Description

Forces a unit to turn towards and walk to provided destination(s). Will not work on [player](../commands/player.md). When [Group](../topics/Group.md) is used as argument, the function will be automatically executed for each unit in the group.

> [!NOTE]
> 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].

## Syntax

```sqf
[unitOrGroup, waypoints, code, walkAnim, completionRadius, endAnim] call BIS_fnc_scriptedMove
```

**Parameters:**

- `unitOrGroup`: [Object](../topics/Object.md) or [Group](../topics/Group.md) - unit or group of units of the class "Man"
- `waypoints`: [Array](../topics/Array.md) of [Position](../topics/Position.md)s in format [pos1, pos2, ...] or [[pos1, completionRadius1, turnSpeedCoef1], [pos2, completionRadius2, turnSpeedCoef2], ...]
- `code`: [Code](../topics/Code.md) or [Array](../topics/Array.md) - (Optional, default `{}`) code to run after each waypoint completion. Format {code} or [[params], {code}]
- `walkAnim`: [String](../topics/String.md) - (Optional, default "AmovPercMwlkSnonWnonDf") walking animation to be played in a loop
- `completionRadius`: [Number](../topics/Number.md) - (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
- `turnSpeedCoef`: [Number](../topics/Number.md) - (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
- `endAnim`: [Number](../topics/Number.md) - (Optional, default [animationState](../commands/animationState.md) 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:** [Script Handle](../topics/Script_Handle.md) or [String](../topics/String.md) or [Nothing](../topics/Nothing.md) - depends on execution (local/remote/error);

## Examples

### Example 1

```sqf
[myUnit, [getMarkerPos "wp1", getMarkerPos "wp2", getMarkerPos "wp3"]] call BIS_fnc_scriptedMove;
```

## See also

[move](../commands/move.md) · [setDriveOnPath](../commands/setDriveOnPath.md) · [BIS_fnc_unitCapture](../functions/BIS_fnc_unitCapture.md)

<sub>Source: [BI Community Wiki — BIS fnc scriptedMove](https://community.bistudio.com/wiki/BIS_fnc_scriptedMove) (revision 347664).</sub>
