Cinemachine: How to create Camera Shake on Unity Cameras

Gabriel Perez
3 min readMar 17, 2022

--

Ever wonder how to have a camera shake effect? It’s very simple!

Camera Shake

Let’s set up a new virtual camera in our scene.

I want to add a handheld effect to the shot above.

Cinemachine Virtual Camera Component

When creating a new virtual camera, we want to access the Cinemachine Virtual Camera component in the inspector tab. At the very bottom of the component, there is a dropdown menu for the “Noise” property.

Click on the dropdown and add “Basic Multi-Channel Perlin.” Cinemachine will add Perlin Noise to the movement of the camera.

We’ll have access to a set of new properties to play with.

Noise Properties

There are 8 camera shake profiles to use!

The noise properties will help simulate camera shake! Let's take a brief look at each property.

Noise Profiles

The noise profiles are assets that can be used for specific camera shakes.

6D Shake could be used for tremors or an earthquake.
The Handheld profiles can be used to create that cameraman handheld feel.

Amplitude Gain

A value of 3 shakes the camera faster.

The Gain to apply to the amplitudes defined in the noise profile. A larger value will shake the camera more rapidly. A value of 0 mutes the noise.

Frequency Gain

A value of 5 shakes the camera more intensely and faster.

The Factor to apply to the frequencies defined in the noise profile. A larger value will intensify the speed of the camera shake.

Pivot Offset

With a pivot of x: 3, y: 4, and z: 4, we have a slight variation to the rotation.

When rotating the camera, the Pivot Offset will offset the camera’s pivot by the values of x, y, and z distance. This generates variation in the positioning to the rotation noise.

Conclusion

Cinemachine provides a simple way to add a camera shake for our needs! Now that we have an understanding of them, let's keep practicing by messing with other profiles and their properties and applying them to our games! The best way to trigger them would be to have trigger boxes on areas that would call the camera shake through code.

Gabriel

--

--

Gabriel Perez

Hello everyone, My name is Gabriel Perez, I am a Unity Developer and a creator who is always learning and experimenting.