# setCinematicCamera (Client)

> Sets the camera shots the cinematic directs during playback. It replaces the earlier shots.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Cinematics
- **URL**: https://wiki.mymp.gg/en/setCinematicCamera

## Syntax

```lua
bool setCinematicCamera(cinematic cinematic, table shots)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `cinematic` | `cinematic` | The cinematic. |
| `shots` | `table` | A list of shots, in order of `start`. An empty list takes the camera out of the cinematic. |

## Returns

`true` if they were applied. `false` if the table is invalid, with a warning saying why.

### Common shot fields

Times are cinematic time, in ms. Each shot starts once the one before has stopped:

- `start`: when it comes in (required).
- `blend`: ms to blend from the shot before. `0` is a cut.
- `stop`: when it stops. Without it, it runs until the next shot; once stopped, the camera holds its last view.
- `shake`: shake in metres, `0` by default. `shakeSpeed`: its frequency in Hz, `12` by default.
- `letterbox`: `true` shows SA's widescreen borders during the shot.

### Path shots

A path shot defines `keys` (a list of keyframes in time order):

- `time`: keyframe time in ms (required).
- `position` and `target`: `vec3` coordinates (required).
- `roll`: roll angle in degrees (`0` by default).
- `fov`: field of view in degrees, above `0` and below `180` (`70` by default).
- `smooth`: `true` follows SA's cutscene curve; `false` goes straight to the next key.
- `ease`: easing to the next key — `"linear"` (default), `"inQuad"`, `"outQuad"`, `"inOutQuad"`, `"inCubic"`, `"outCubic"` or `"inOutCubic"`.

### Actor-following shots

A shot that follows an actor defines:

- `actor`: the actor's name (required).
- `offset`: camera offset as a `vec3` in the actor's space (required).
- Aim target: `lookAt` (a `vec3` in the actor's space), `lookAtActor` (another actor's name) or `lookAtBone` (a ped's bone).
- `roll` and `fov`: optional roll and field of view in degrees.

## Example

```lua
local intro = createCinematic("cinematics/intro.cine")
setCinematicCamera(intro, {
    {
        start = 0,
        letterbox = true,
        keys = {
            { time = 0, position = vec3(2480, -1700, 30), target = vec3(2495, -1680, 14) },
            { time = 6000, position = vec3(2500, -1700, 20), target = vec3(2495, -1680, 14), ease = "inOutQuad" },
        },
    },
    { start = 6000, blend = 1000, actor = "hero", offset = vec3(0, -4, 1.5), lookAtActor = "hero" },
})
```

## See also

- [getCinematicCamera (Client)](https://wiki.mymp.gg/en/getCinematicCamera.md): Returns the cinematic's camera shots.
- [getCinematicShotView (Client)](https://wiki.mymp.gg/en/getCinematicShotView.md): Returns where a shot's camera stands and what it looks at, at a cinematic time, shake included.
- [setCinematicCameraEnabled (Client)](https://wiki.mymp.gg/en/setCinematicCameraEnabled.md): Turns the cinematic's camera on or off. While off, playback does not move the camera and the shots of setCinematicCamera are ignored.
- [setCameraMatrix (Client)](https://wiki.mymp.gg/en/setCameraMatrix.md): Fixes the camera at a point, looking at another, until setCameraTarget gives it back to a ped.
