---
name: "animateBay"
type: command
status: ok
groups: ["Animations", "Vehicle Loadouts"]
arma3_since: "1.70"
locality: {"argument": "global", "effect": "local", "server_exec": false}
source: https://community.bistudio.com/wiki/animateBay
revid: 347988
updated: 2023-11-08T10:17:14Z
---

# animateBay

*Command · Animations, Vehicle Loadouts · Arma 3 v1.70*

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

## Description

Forces animation of bay to given state, -1 for reset to engine handling, can cause weapon inoperative, because weapon is released when bay state == 1.

> [!NOTE]
> While there is no getter to read the animation phase of the given bay, the [animationPhase](../commands/animationPhase.md) command can be used with the individual bay door name from [animationNames](../commands/animationNames.md) as a workaround (See [#Example 3](../commands/animateBay.md#example-3)).

## Syntax

```sqf
vehicle animateBay [bay, animphase, instant]
```

**Parameters:**

- `vehicle`: [Object](../topics/Object.md)
- `bay`: [Number](../topics/Number.md) - bay index (index starts from 1 and different from pylon index)
- `animphase`: [Number](../topics/Number.md) - animation phase in range 0..1
- `instant`: [Boolean](../topics/Boolean.md) - (Optional, default [false](../commands/false.md)) animate immediately

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

## Examples

### Example 1

```sqf
vehicle player animateBay [1, 0.5];
```

### Example 2

```sqf
vehicle player animateBay [1, 1, true];
```

### Example 3

Getter example, here for the UCAV Sentinel:

```sqf
ucav animateBay [1, 1];
// can be checked with
ucav animationPhase "weapons_bay_l_1";
// or
ucav animationPhase "weapons_bay_l_2";
```

## See also

Arma 3: Vehicle Loadouts · [getCompatiblePylonMagazines](../commands/getCompatiblePylonMagazines.md) · [getPylonMagazines](../commands/getPylonMagazines.md) · [setAmmoOnPylon](../commands/setAmmoOnPylon.md) · [ammoOnPylon](../commands/ammoOnPylon.md) · [animatePylon](../commands/animatePylon.md) · [setPylonsPriority](../commands/setPylonsPriority.md) · [setPylonLoadout](../commands/setPylonLoadout.md)

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