Arma 3 Scripting

Function in Ambient

BIS_fnc_ambientAnim

Also available as Markdown and JSON, or read the original wiki page.

Description

Play set of ambient animations on given unit. If the unit should react to combat, use BIS_fnc_ambientAnimCombat instead.

Note

Animations can be cancelled using _unit call BIS_fnc_ambientAnim__terminate.

Syntax

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

Parameters:

Returns: Nothing

Examples

Example 1

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

Example 2

// 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 · BIS_fnc_ambientAnimGetParams

Community notes

PierreMGI

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:

[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 doesn't need this script but the list of animations is limited.

Icaruk

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

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