# Camera Shake

The aforementioned camera components do not inherently support camera shake, camera postprocessing and camera lens effects. But we can figure out some ways to achieve them.

You can readily use the UE5 built-in blueprint nodes *StartCameraShake*, *StartCameraShakeFromSource* and *PlayWorldCameraShake* to invoke a specific camera shake as you want. For camera shakes from source, you can also use nodes *Start* and *StartCameraShake* where Target is Camera Shake Source Component.

1. Create a camera shake class. Right click on content browser, select "Blueprint Class", search for "CameraShakeBase" or "LegacyCameraShake" and clike "Select". By doing this, you create a new camera shake class. Open it, and tune the parameters on the `Details` panel. You should specify the camera shake duration, blend time, and oscilliation. You can also specify an animation shake under the `Anim Shake` group. <br>

   <figure><img src="https://1253177398-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIc7aRtmwmEkkqEJZORmC%2Fuploads%2FBreFFKZWMDsQf2rDeY7Y%2Fadd-shake.png?alt=media&#x26;token=b770f7fe-b3e4-4eb5-95b3-14eeea0e1535" alt=""><figcaption></figcaption></figure>
2. Call camera shake. Back to the blueprint you want to use camera shakes, and use node *StartCameraShake*, *StartCameraShakeFromSource* or *PlayWorldCameraShake* where you can pass in the camera shake class you've just created.&#x20;

   * If you are using nodes *StartCameraShake* and *StartCameraShakeFromSource*, you should pass in the player camera manager.&#x20;
   * If you are using *PlayWorldCameraShake*, you should specify the location where the camera shake is playing, the effect inner radius and outer radius, as well as the falloff between the two circles.&#x20;
   * If you want to trigger camera shakes from source, you can also use the *Start* and *StartCameraShake* nodes where Target is CameraShakeSourceComponent.

   <figure><img src="https://1253177398-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIc7aRtmwmEkkqEJZORmC%2Fuploads%2Fy3ud3ki652lsVhnsGGQH%2Fcamera-shake-nodes.png?alt=media&#x26;token=6363f4e7-1c54-4e0a-97ce-2760773c5557" alt=""><figcaption></figcaption></figure>
3. If you want to stop camera shakes at runtime, you can call the *StopCameraShake*, *StopAllCameraShakes* and *StopAllInstancesOfCameraShake* to terminate active camera shakes of certain class types. All these three nodes require a player camera manager object. You can use node `GetPlayerCameraManager` to get it. It is particularly noteworthy that if the active camera shake is infinite (the value of duration set as zero or negative) and you toggle off the "Immediately" option, this camera shake will not be stoppped as you may expect. You can set the shake duration as a large value to resolve this issue. (Update: this issue has been fixed at UE 5.2)<br>

   <figure><img src="https://1253177398-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIc7aRtmwmEkkqEJZORmC%2Fuploads%2F6ePG5pDw3A9sAKCURVtd%2Fstopshakenode.png?alt=media&#x26;token=4a90d3fe-782e-4262-9688-7421e61c3f12" alt=""><figcaption></figcaption></figure>
4. If you want to place a source in your level and automatically trigger camera shake during gameplay, you can click "Add"->"All Classes"->"Camera Shake Source Actor". Place it anywhere you want in your level, and set the value of parameter `Camera Shake` to the camera shake class you'd like to use. Most of the time you should also toggle on `Auto Start`. Refer to the official [Camera Shakes](https://docs.unrealengine.com/5.1/en-US/camera-shakes-in-unreal-engine/) documentation to learn about some basics of camera shakes.

ComponentCameraSystem provides a more convenient way to configure your camera shake without first creating a new camera shake class from blueprint, though you can still provide a shake instance as usual. Just set up the `EPlayerCameraManager` in your controller and use the blueprint nodes [EasyStartCameraShake ](https://sulleyyys-organization.gitbook.io/manuals-of-ccs/blueprint-nodes-list/ecameralibrary#easystartcamerashake)and [EasyStartCameraShakeFromSource ](https://sulleyyys-organization.gitbook.io/manuals-of-ccs/blueprint-nodes-list/ecameralibrary#easystartcamerashakefromsource)under the `Utils` category.&#x20;

<figure><img src="https://1253177398-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIc7aRtmwmEkkqEJZORmC%2Fuploads%2FAZSCsRHRg9tUFkMdSABN%2Feasy-camera-shake-nodes.png?alt=media&#x26;token=c6721aa5-0c79-4ec4-abe6-48ceb62b8f2f" alt=""><figcaption></figcaption></figure>

You should be very careful of the [EasyStartCameraShakeFromSource ](https://sulleyyys-organization.gitbook.io/manuals-of-ccs/blueprint-nodes-list/ecameralibrary#easystartcamerashakefromsource)node in that this node will instantiate a [ECameraShakeSourceActor ](https://sulleyyys-organization.gitbook.io/manuals-of-ccs/camera-components/miscellaneous/ecamera-shake-source-actor)at where the source should be placed. If there already exists one in the world, this one will be leveraged and moved to the new place. For safety consideration, you should not use this node for infinite camera shakes. If this is your intention, you should use the built-in `StartCameraShakeFromSource` node where you must specify a camera shake source component so that you can manually decide when this shake instance is stopped.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sulleyyys-organization.gitbook.io/manuals-of-ccs/basic-uses/camera-shake.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
