---
name: "Arma 3: Animals: Override Default Animal Behaviour Via Script"
type: topic
aliases: ["Arma 3 Animals: Override Default Animal Behaviour Via Script"]
source: https://community.bistudio.com/wiki/Arma_3:_Animals:_Override_Default_Animal_Behaviour_Via_Script
revid: 370875
updated: 2025-02-21T10:44:01Z
---

# Arma 3: Animals: Override Default Animal Behaviour Via Script

Animals in Arma 3 roam freely according to their [FSM](../topics/FSM.md); they autonomously walk, stop, eat, flee etc.
In order to control them fully you will need to override their default behaviour and manually guide them, all with a bit of scripting.

### Animal Creation

Animal classnames can be found on the [Arma 3: CfgVehicles Animals](../topics/CfgVehicles_Animals.md) page.

#### createAgent Command

Spawning animals via [createAgent](../commands/createAgent.md) is the best way how to have control over them in your mission.\
An **agent** is a "light AI" that doesn't have all the abilities/intelligence of a "normal" AI unit created via [createUnit](../commands/createUnit.md);
therefore, they **cannot** be controlled via commands such as [doMove](../commands/doMove.md) and [doStop](../commands/doStop.md). However, low-level commands such as [moveTo](../commands/moveTo.md) or [setDestination](../commands/setDestination.md) will work.

For a basic example see [Example script](../topics/Animals~3A_Override_Default_Animal_Behaviour_Via_Script.md#example-script).

#### Animals Module

The Animals module can be found in Eden Editor in the Modules page (<kbd>F5</kbd>), under the Sites category.

Insert the module in editor, set the desired parameters and you have animals in your mission.\
Spawned animals will be for mission decoration purpose instead of heavily-scripted behaviour.

### Disable animal's scripted behaviour

You can disable [animal's scripted behaviour](../functions/BIS_fnc_animalBehaviour.md) using the following:

```sqf
_animal setVariable ["BIS_fnc_animalBehaviour_disable", true];
```

### Animations

Animations can be played using [playMove](../commands/playMove.md), [playMoveNow](../commands/playMoveNow.md) or [switchMove](../commands/switchMove.md). Their names are quite self-explanatory.

> [!IMPORTANT]
> Animals will remain in the same animation cycle until manually changed!

#### Dog

```sqf
_dog playMove "Dog_Stop";
_dog playMove "Dog_Sit";
_dog playMove "Dog_Walk";
_dog playMove "Dog_Run";
_dog playMove "Dog_Sprint";
_dog playMove "Dog_Idle_Stop"; // wandering, default behaviour
```

- "Dog_Idle_Stop"
- "Dog_Idle_Walk"
- "Dog_Die"
- "Dog_Run"
- "Dog_Sprint"
- "Dog_Sit"
- "Dog_Stop"
- "Dog_Idle_01"
- "Dog_Idle_02"
- "Dog_Idle_03"
- "Dog_Idle_04"
- "Dog_Idle_05"
- "Dog_Idle_06"
- "Dog_Idle_07"
- "Dog_Idle_08"
- "Dog_Idle_09"
- "Dog_Idle_10"
- "Dog_Idle_Sit01"
- "Dog_Idle_Sit02"
- "Dog_Idle_Sit03"
- "Dog_Idle_Sit04"
- "Dog_Idle_Sit05"
- "Dog_Idle_Sit06"
- "Dog_Idle_Sit07"
- "Dog_Idle_Sit08"
- "Dog_Idle_Bark"
- "Dog_Idle_Growl"
- "Dog_Idle_Walk"
- "Dog_Idle_Run"
- "Dog_Idle_Sprint"
- "Dog_TurnL"
- "Dog_TurnR"

#### Sheep

```sqf
_sheep playMove "Sheep_Stop";
_sheep playMove "Sheep_Walk";
_sheep playMove "Sheep_Run";
_sheep playMove "Sheep_Idle_Stop"; // wandering, default behaviour
```

#### Goat

```sqf
_goat playMove "Goat_Stop";
_goat playMove "Goat_Walk";
_goat playMove "Goat_Run";
_goat playMove "Goat_Idle_Stop"; // wandering, default behaviour
```

#### Rabbit

```sqf
_rabbit playMove "Rabbit_Stop";
_rabbit playMove "Rabbit_Hop";
_rabbit playMove "Rabbit_Idle_Stop"; // wandering, default behaviour
```

#### Cockerel

```sqf
_cock playMove "Cock_Stop";
_cock playMove "Cock_Walk";
_cock playMove "Cock_Run";
_cock playMove "Cock_Idle_Stop"; // wandering, default behaviour
```

#### Hen

```sqf
_hen playMove "Hen_Stop";
_hen playMove "Hen_Walk";
_hen playMove "Hen_Idle_Stop"; // wandering, default behaviour
```

#### Snake

```sqf
_snake playMove "Snakes_Stop";
_snake playMove "Snakes_Move";
_snake playMove "Snakes_Idle_Stop"; // wandering, default behaviour
```

### Examples

#### Script

Simple example for a dog to follow the player:

```sqf
// spawn dog
_dog = createAgent ["Fin_random_F", getPosATL player, [], 5, "NONE"];

// disable animal behaviour
_dog setVariable ["BIS_fnc_animalBehaviour_disable", true];

// following loop
[_dog] spawn {
    params ["_dog"];

    // force dog to sprint
    _dog playMove "Dog_Sprint";

    while { sleep 3; alive _dog } do
    {
        _dog moveTo getPosATL player;
    };
};
```

See in action: [YouTube](https://www.youtube.com/watch?v=0X8oumNj9kc)

<sub>Source: [BI Community Wiki — Arma 3: Animals: Override Default Animal Behaviour Via Script](https://community.bistudio.com/wiki/Arma_3:_Animals:_Override_Default_Animal_Behaviour_Via_Script) (revision 370875).</sub>
