Unity3D: Camera Shake Effect with C# Example
One of my unfinished Unity3D game projects required camera shaking function, so I wrote one from scratch.
I just needed a script that shakes camera for a certain time and magnitude, and can be called from other script. Also, sometimes it would be useful to trigger this from UI button using OnClick().
Added 9.10.2018: This script is now available also at GitHub:
https://github.com/jliias/CommonUnityScripts/blob/master/CameraScripts/ShakeCamera.cs
Please find script below:
Script is added as a script component to the Camera type object and then it should be ready for use. You just have to figure out how and when to trigger it in your own game.
I hope that someone will find this script snippet useful!
-Jussi
I just needed a script that shakes camera for a certain time and magnitude, and can be called from other script. Also, sometimes it would be useful to trigger this from UI button using OnClick().
Added 9.10.2018: This script is now available also at GitHub:
https://github.com/jliias/CommonUnityScripts/blob/master/CameraScripts/ShakeCamera.cs
Please find script below:
Script is added as a script component to the Camera type object and then it should be ready for use. You just have to figure out how and when to trigger it in your own game.
I hope that someone will find this script snippet useful!
-Jussi
I am impressed with the post which you have shared. The blog you have shared is incredibly helpful. The tips you have shared related to web development is really informative. Thanks for sharing this blog!
ReplyDeleteUnity 3D Game Development Services
I am really happy to say it’s an amazing post to read. I learn new information from your article, you are doing a great job. Keep it u
ReplyDeletePoker Game Development Company