---
name: "BIS_fnc_ambientAnim"
type: function
status: ok
groups: ["Ambient"]
arma3_since: "1.00"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_ambientAnim
revid: 329376
updated: 2022-07-27T12:38:16Z
---

# BIS_fnc_ambientAnim

*Function · Ambient · Arma 3 v1.00*

## Description

Play set of ambient animations on given unit. If the unit should react to combat, use [BIS_fnc_ambientAnimCombat](../functions/BIS_fnc_ambientAnimCombat.md) instead.

> [!NOTE]
> Animations can be cancelled using `_unit call BIS_fnc_ambientAnim__terminate`.

## Syntax

```sqf
[unit, animationSet, equipmentLevel, snapTo, interpolate, attachToLogic] call BIS_fnc_ambientAnim
```

**Parameters:**

- `unit`: [Object](../topics/Object.md) - unit that will play the animations
- `animationSet`: [String](../topics/String.md) - the animation set to play. Possible values:

  |  |  |  |
  |---|---|---|
  | *some values are missing due to duplicate results, e.g "STAND" does the same as "STAND1"* |  |  |
  | - STAND1<br>- STAND2<br>- STAND_U1<br>- STAND_U2<br>- STAND_U3<br>- WATCH<br>- WATCH2<br>- GUARD<br>- LISTEN_BRIEFING<br>- LEAN_ON_TABLE<br>- LEAN | - SIT_AT_TABLE<br>- SIT1<br>- SIT<br>- SIT3<br>- SIT_U1<br>- SIT_U2<br>- SIT_U3<br>- SIT_HIGH1<br>- SIT_HIGH<br>- SIT_LOW<br>- SIT_LOW_U<br>- SIT_SAD1<br>- SIT_SAD2 | - KNEEL<br>- REPAIR_VEH_PRONE<br>- REPAIR_VEH_KNEEL<br>- REPAIR_VEH_STAND<br>- PRONE_INJURED_U1<br>- PRONE_INJURED_U2<br>- PRONE_INJURED<br>- KNEEL_TREAT<br>- KNEEL_TREAT2<br>- BRIEFING<br>- BRIEFING_POINT_LEFT<br>- BRIEFING_POINT_RIGHT<br>- BRIEFING_POINT_TABLE |
- `equipmentLevel`: [String](../topics/String.md) - the equipment level of the unit. Possible values:
  - NONE
  - LIGHT
  - MEDIUM
  - FULL
  - ASIS
  - RANDOM
- `snapTo`: [Object](../topics/Object.md) - (Optional, default [objNull](../commands/objNull.md)) the object where the unit will be snapped to
- `interpolate`: [Boolean](../topics/Boolean.md) - (Optional, default [false](../commands/false.md)) should try to interpolate into the ambient animation. Works only for some default stances
- `attachToLogic`: [Boolean](../topics/Boolean.md) - (Optional, default [true](../commands/true.md)) [true](../commands/true.md) to [attach](../commands/attachTo.md) the unit to the created logic object, forcing it in one position

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

## Examples

### Example 1

```sqf
[player, "STAND1", "ASIS"] call BIS_fnc_ambientAnim;
```

### Example 2

```sqf
// will search for a chair within 2 meters around the unit and will place the unit on it
[_unit, "SIT", "NONE"] call BIS_fnc_ambientAnim;
```

## See also

[BIS_fnc_ambientAnimCombat](../functions/BIS_fnc_ambientAnimCombat.md) · [BIS_fnc_ambientAnimGetParams](../functions/BIS_fnc_ambientAnimGetParams.md)

## Community notes

**PierreMGI** — 2016-02-19

In 3den editor, place a blufor unit (B_soldier_A_F) near a camping chair (land_campingChair_V2_F).

In init field of the unit:

```sqf
[this, "SIT2"] call BIS_fnc_ambientAnim;
0 = this spawn {
    waitUntil { behaviour _this == "combat"};
    _this call BIS_fnc_ambientAnim__terminate;
};
```

When this unit is aware of a threat, he will quit the "ambient animation" and will able to return fire.

Note: [BIS_fnc_ambientAnimCombat](../functions/BIS_fnc_ambientAnimCombat.md) doesn't need this script but the list of animations is limited.

---

**PierreMGI** — 2016-08-08

To make this command working in MP (hosted server tested)

```sqf
[this, "SIT2"] call BIS_fnc_ambientAnim; // wrong! the first JIP will throw the unit to position [0,0,0]
if (isServer) then { [this, "SIT2"] call BIS_fnc_ambientAnim; }; // wrong! only player located on server will see the animation
if (local this) then { [this, "SIT2"] call BIS_fnc_ambientAnim; }; // OK, best way
if (isServer) then { [this, "SIT2"] remoteExecCall ["BIS_fnc_ambientAnim"]; }; // OK
```

---

**Icaruk** — 2016-08-11

Be careful using this function multiple times on MP, it creates a Logic using [createUnit](../commands/createUnit.md) (which is global).

If you use it on 20 units, 20 additional logics will be created.

<sub>Source: [BI Community Wiki — BIS fnc ambientAnim](https://community.bistudio.com/wiki/BIS_fnc_ambientAnim) (revision 329376).</sub>
