---
name: "animateDoor"
type: command
status: ok
groups: ["Animations"]
arma3_since: "0.50"
locality: {"argument": "global", "effect": "global", "server_exec": false}
source: https://community.bistudio.com/wiki/animateDoor
revid: 347589
updated: 2023-09-28T20:03:54Z
---

# animateDoor

*Command · Animations · Arma 3 v0.50*

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

## Description

Animates a door on a vehicle. Animation is defined in config file in CfgVehicles -> AnimationSources. Wanted animation phase is set with phase param. This command works only on animation sources with "door" controller. Door_L in the example below can be animated with [animateDoor](../commands/animateDoor.md) but not CargoRamp_Open: `heli animateDoor ["Door_L", 1];`

> [!IMPORTANT]
> [animateDoor](../commands/animateDoor.md) `phase` param will be rounded: anything >0.5 will be rounded to 1 and <=0.5 will be rounded to 0. Therefore it is not possible to open a door half way with this command

```cpp
class AnimationSources
{
    class CargoRamp_Open
    {
        source = "user";
        animPeriod = 5;
        initPhase = 0;
    };
    class Door_L
    {
        source = "door";
        animPeriod = 1.6;
    };
};
```

To animate doors or other sources that have "user" controller, use [animate](../commands/animate.md) command, or even better, [animateSource](../commands/animateSource.md) (recommended). Sources with "hit" controller can be animated with [setHitPointDamage](../commands/setHitPointDamage.md) command applied to the name contained in hitpoint property. For availability of animation sources and their controller types see: Arma 3: createVehicle/vehicles

## Syntax

```sqf
object animateDoor [doorname, phase, instant]
```

**Parameters:**

- `object`: [Object](../topics/Object.md)
- `doorname`: [String](../topics/String.md)
- `phase`: [Number](../topics/Number.md)
- `instant`: [Boolean](../topics/Boolean.md) - (Optional, default [false](../commands/false.md)) when [true](../commands/true.md) and phase is either 0 or 1, door will change phase instantaneously

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

## Examples

### Example 1

```sqf
Taru animateDoor ["Door_1_source", 1];
```

### Example 2

Open left front door on Ifrit instantly:

```sqf
Ifrit animateDoor ["Door_LF", 1, true];
```

## See also

[doorPhase](../commands/doorPhase.md) · [setFaceAnimation](../commands/setFaceAnimation.md) · [animate](../commands/animate.md) · [animationPhase](../commands/animationPhase.md) · [animateSource](../commands/animateSource.md) · [animationSourcePhase](../commands/animationSourcePhase.md) · [animationNames](../commands/animationNames.md)

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