Shaking the screen (Camera + GUI )

I am currently adding a random vector the camera to simulate a shaking effect

However, it does not shake GUI elements on the screen (such as GUI.Label or GUI.Window). Is there a way to shake the viewport or the final rendered display?


Think about how you paint the GUI on the screen... you write the coordenates where it should start... so, every time you repaint change the coordinates....

I suggest you to write a method for calculating coordinates, when the camera is still, when the camera shakes.

Hope this is a good solution.

I am looking forward to other solutions, and to see how do you solve this issue.

Good luck

If you're rendering GUI elements there should be a GUI layer component attached to the camera. The position of this can be accessed using:


you can move that around to simulate shaking as well as using the transform.translate function