# fadeCamera (Client)

> Fades the screen out to a colour or back in.

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

## Syntax

```lua
bool fadeCamera(bool fadeIn [, float time = 1, int red = 0, int green = 0, int blue = 0])
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `fadeIn` | `bool` | `true` to fade the screen in, `false` to fade it out. |
| `time` | `float` | How long the fade takes, in seconds. *(default: `1`)* |
| `red` | `int` | The colour's red, from 0 to 255. Only used when fading out. *(default: `0`)* |
| `green` | `int` | The colour's green, from 0 to 255. Only used when fading out. *(default: `0`)* |
| `blue` | `int` | The colour's blue, from 0 to 255. Only used when fading out. *(default: `0`)* |

## Returns

`true`.

## Example

```lua
fadeCamera(false, 1.5)
setTimer(function()
    setCameraTarget(localPlayer)
    fadeCamera(true, 1.5)
end, 2000, 1)
```

## See also

- [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.
- [setCameraTarget (Client)](https://wiki.mymp.gg/en/setCameraTarget.md): Makes the camera follow a player or ped, as in normal play. It also undoes setCameraMatrix and attachCameraToElement.
