How to create a camera shake effect in Unity

To create a compelling story, different mechanisms are used, one of them is the camera shake effect, used to portray some kind of violence like a bomb going off or you being shot at.

Press ‘s’ to shake the camera.
Press ‘s’ to shake the camera.
Camera Shake Effect
Attaching the script to the camera.
Attaching the script to the camera.
Attach the CameraShake script to the camera.

Random.insideUnitSphere Returns a random point inside a sphere with radius 1.

Create your variables here.
Create your variables here.
Create your variables.
Assigning of positions in void start.
Assigning of positions in void start.
void Start().
The void update method, the place where the magic happens.
The void update method, the place where the magic happens.
void Update().
The magic of code, where the camera shake happens.
The magic of code, where the camera shake happens.
The CameraShake() function.
When this is called the magic stops, this stops camera shake.
When this is called the magic stops, this stops camera shake.
The StopShake() function.
How it went.

Hi, I am Coded Kaa. I am a game developer👨‍💻, YouTuber🎬 , and I read books📚. I love to program new things, I greatly enjoy reading and exploring new ideas.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store