Home

Awesome

Perlin Camera Shake component for Unity3D

Just a camera shake MonoBehaviour script that you can attach to a Camera as a component in Unity3D. I guess it can be ideal if you just need camera shake, and would rather not use the full Cinemachine package.


Version information: Tested in Unity 2018.3, requires scripting runtime set to '.Net 4.x equivalent' (uses C# 7 features)


Main feature: It's not crappy code

Overall it should be performant. Not that it matters a lot probably, but still. ;)

Prerequisites

Usage

Obviously, you'll need to add 'trauma' during runtime to initiate the camera shake. You can do this by directly accessing the public Trauma property of the component. I used it with my own event system instead, but I commented out the event-related lines. Feel free to remove these if you're not gonna use any event system.

Settings

You can customize the following parameters of the Perlin noise based camera shake in the Inspector:

Editor customization options of the Perlin Camera Shake component

Bugs

Hopefully none. If you happen to find any, let me know, and I'll fix them.

Licence

It appears that some people are using this component, so I added an explicit MIT licence for your peace of mind.

Sources/inspirations