A downloadable asset pack

Download NowName your own price

NOTICE:

Due to a error noticed on the 30/12/2021 any downloads prior to that date had an error. The new uploaded version works better and includes a proper test scene. 

Welcome To My Instant ScreenShake Package!

What is this, and how do I use it?

I've tried to make the simplest, easiest to use Screenshake prefab package. Where all you have to do is delete the main cam, then drag and drop the prefab! Then whenever you call CamShaker.Shake(float _duration, float _intensity) in code from anywhere it will shake the screen for the duration and amount you've asked for. Furthermore I've made sure that moving the main Camera while screenshaking still works! So this is very much compatible with Cinemachine. 


How does it work?

The way I've made this is by making the camera only render UI. Then on a canvas which has been made to fit the camera's size I've placed a camera which renders everything but UI, and passes in everything it sees to a render texture. Then on the canvas there's a raw Image with the render texture overlayed. Whenever the function to shake is called, instead of shaking the camera, the texture is moved. 

Why did I choose to make it this way?

In the past, I've had issues where when I move the camera and I want to call a sceenshake function either through an animation controller or by other means it either fails to properly shake the camera, or it fails to track the camera's movement while shaking.  While this could be fixed by offsetting all shaking towards whatever the camera is tracking, I wanted to experiment using render textures. I'm aware this is most likely, not the most efficient way of making a screen shaking function, but I belive that experimenting with different tools is highly important. 


Using this in projects:

If you're using this for a project that is not a gamejam project, please give me a special thanks in the credits. Otherwise, if this is for a gamejam project, go wild, I don't mind. 


StatusReleased
CategoryAssets
Rating
Rated 5.0 out of 5 stars
(1 total ratings)
AuthorPip (Agapios Kokkos)
Tagsfree, screenshaker, shake, Unity

Download

Download NowName your own price

Click download now to get access to the following files:

CamShaker.unitypackage 142 kB

Leave a comment

Log in with itch.io to leave a comment.