---
name: "camPreload"
type: command
status: ok
groups: ["Camera Control"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/camPreload
revid: 369112
updated: 2024-09-03T10:28:47Z
---

# camPreload

*Command · Camera Control · Arma 3 v0.50 · introduced in Armed Assault v1.00*

## Description

Preloads the scene for the prepared camera with given timeout after which preloading is aborted. Max timeout is 30 seconds. Timeout of 0 means max timeout of 30 seconds as well. 

> [!NOTE]
> This command will read prepared params set with camPrepareFOV, [camPreparePos](../commands/camPreparePos.md) and [camPrepareTarget](../commands/camPrepareTarget.md), so no [camCommitPrepared](../commands/camCommitPrepared.md) is necessary. If camPrepareFOV is not set, the default value is 1. If [camPrepareTarget](../commands/camPrepareTarget.md) (for direction) and [camPreparePos](../commands/camPreparePos.md) (for position) are not set, current [direction](../commands/direction.md) and [position](../commands/position.md) of the camera are used. The prepared camera preload will preload main camera as well. [cameraEffect](../commands/cameraEffect.md) is not necessary

## Syntax

```sqf
camera camPreload timeout
```

**Parameters:**

- `camera`: [Object](../topics/Object.md)
- `timeout`: [Number](../topics/Number.md)

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

## Examples

### Example 1

```sqf
_camera camPreload 5;
```

### Example 2

Preload camera around player to avoid stuttering on optics zooming:

```sqf
0 spawn 
{
    _cam = "camera" camCreate (player selectionPosition "camera");
    for "_i" from 0 to 359 do
    {
        _cam setDir _i;
        _cam camPrepareFov 0.25;
        _cam camPreload 0;
        waitUntil { camPreloaded _cam };
    };
    camDestroy _cam;
};
```

## See also

[camPreloaded](../commands/camPreloaded.md) · [preloadCamera](../commands/preloadCamera.md)

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