# Camera Shake

**Camera Shake** is an important aspect of the camera animation in game. The **FPS Animation Framework** allows you to play the camera shakes in runtime, by simply accessing the **FPSCamera** component:

```csharp
_fpsCameraController.PlayCameraShake(cameraShake);
```

The cameraShake parameter is a Scriptable Object, which you can create by right-clicking:

<mark style="background-color:purple;">**Create -> KINEMATION -> FPS Animator General -> Camera Shake**</mark>

<figure><img src="https://784345943-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxcUmJ78NSw1bSUlSO9oP%2Fuploads%2FUWeiYTfs82BIPQXAg8ln%2Fimage.png?alt=media&#x26;token=bc288395-4322-49b4-80e5-e8ee88f998f5" alt="" width="376"><figcaption><p>Camera Shake.</p></figcaption></figure>

**X, Y and Z** are animation curves, which animate the respective rotation axis.

**Pitch, Yaw and Roll** represent the ranges for minimum and maximum target values. The value is computed using this formula:

```csharp
public static float GetTarget(Vector4 value)
{
    float a = Random.Range(value.x, value.y);
    float b = Random.Range(value.z, value.w);
    return Random.Range(0, 2) == 0 ? a : b;
}
```

**Smooth Speed** defines the interpolation speed.

**Play Rate** defines the animation speed.
