Camera Shake Effect in Unity

Brian Ratnasinghe
2 min readJul 16, 2021

--

Hello everyone, in this article I will discuss how to implement a basic camera shaking effect when the play take damage. When I first decided to implement this I though it would be hassle until I realized that all we are really doing here is translating the transform for the main camera. But, before we can get into that we need to start by finding the camera game object using GameObject.Find.

Now we can simply call this the object and access the transform component to slightly move the camera multiple times in order to give a shaking effect to the screen. I used an Enumerator method here in order to be sure that the player can still move while the camera shakes. I also used random numbers to be sure that the same shake does not happen every time.

Here is what the final result looks like. Thanks for reading.

--

--

Brian Ratnasinghe
Brian Ratnasinghe

Written by Brian Ratnasinghe

Here I am documenting everything I am learning in order to become a successful game developer.

No responses yet