---
name: "switchGesture"
type: command
status: ok
groups: ["Animations"]
arma3_since: "0.50"
locality: {"argument": "local", "effect": "global", "server_exec": false}
source: https://community.bistudio.com/wiki/switchGesture
revid: 376921
updated: 2025-12-29T12:08:48Z
---

# switchGesture

*Command · Animations · Arma 3 v0.50 · introduced in Arma 2 v1.00*

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

## Description

When used on a person,the given move is started immediately (without transition).

> [!NOTE]
> **Arma 3:** Since Arma 3 v2.18 it is possible to play [gesture states](../commands/gestureState.md) (define in config under `"CfgGesturesMale" >> "states"` for male soldiers).
> In addition, it is also possible to play [move states](../commands/animationState.md) (define in config under `"CfgMovesMaleSdr" >> "states"` for male soldiers) as gestures if they have a valid mask defined in their configs (for example, weapon switching animations have a "WeaponSwitching" mask that only affects the upper body, so they work correctly with this command).

## Syntax

### Syntax 1

```sqf
soldier switchGesture moveName
```

**Parameters:**

- `soldier`: [Object](../topics/Object.md)
- `moveName`: [String](../topics/String.md)

**Returns:** [Nothing](../topics/Nothing.md)

### Syntax 2

*since arma3 2.18*

```sqf
soldier switchGesture [moveName, time, blendFactor, resetAim]
```

**Parameters:**

- `soldier`: [Object](../topics/Object.md)
- `moveName`: [String](../topics/String.md) - entry from `"CfgMovesMaleSdr" >> "states"` or `"CfgGesturesMale" >> "states"`
- `time`: [Number](../topics/Number.md) - (Optional, default 0) normalised time, in range 0..1, where 0 = beginning of the animation, and 1 = end of the animation
- `blendFactor`: [Number](../topics/Number.md) -  (Optional, default 1) how much to blend the current animation with the new animation, in range 0..1, where 0 = current animation, and 1 = new animation. When 1 is used, the switching is instant (not smooth).
- `resetAim`: [Boolean](../topics/Boolean.md) - (Optional, default true) whether the aim/head direction should be reset after switching

**Returns:** [Nothing](../topics/Nothing.md)

## Examples

### Example 1

```sqf
soldierOne switchGesture "Wave";
```

### Example 2

```sqf
// Create a dummy agent that copies your moves
ai1 = createAgent [typeOf player, getPosATL player, [], 0, "NONE"];
ai1 disableAI "ALL";

onEachFrame
{
    ai1 setAnimSpeedCoef getAnimSpeedCoef player;
    ai1 setVectorDir vectorDir player;
    private _m = animationState player;
    private _g = gestureState player;
    private _i = getUnitMovesInfo player;
    private _a = getUnitMovesInfo ai1;

    if (animationState ai1 != _m || abs(_i # 1 - _a # 1) > 0.1) then
    {
        ai1 switchMove [_m, _i # 0, _i # 3, false];
    };

    if ((gestureState ai1 != _g || abs(_i # 6 - _a # 6) > 0.1) && (_g != "<none>" && _g find "_player" < 0)) then
    {
        ai1 switchGesture [_g, _i # 5, _i # 8, false];
    };
}
```

## See also

[playGesture](../commands/playGesture.md) · [getUnitMovesInfo](../commands/getUnitMovesInfo.md) · [switchMove](../commands/switchMove.md)

## Community notes

**.kju** — 2010-08-31

Rpt says "Not implemented" as of OA 1.54.

<sub>Source: [BI Community Wiki — switchGesture](https://community.bistudio.com/wiki/switchGesture) (revision 376921).</sub>
