Is it possible to shake the screen rather than shake the camera?

Hi, for my action game I’ve been implementing a method to create a screen shake effect that will be used when bullets are fired by the player.

So far I’ve successfully written a script that utilises perlin noise to move the camera. My problem, however, is that I am shaking a perspective camera, which means that objects further away shake far less than objects in the foreground when the script is enabled. This results in quite a weird effect and reduces the potency of the screen shake illusion.

Is there a way to actually shake the whole of the view (preferably without moving the GUI) instead of just the camera in Unity, meaning that all objects will shake at the same magnitude regardless of their distance from the camera? My game is effectively in 2.5D with a topdown view, with an additional camera which zooms in to the player, so (I’d think) objects do actually need to be at various y coordinates to achieve proper parallax.

Hopefully I’ve made myself clear, thanks in advance for helping!

Thanks to @Eric5h5 pointing me in the direction of adjusting the camera projection, I have managed to make a very simple function that offsets the camera by the passed amount in the x and y directions -

void OffsetCameraObliqueness (float xOffset, float yOffset) {
    float frustrumHeight = 2 * camera.nearClipPlane *
        Mathf.Tan(camera.fieldOfView * 0.5f * Mathf.Deg2Rad);
	float frustrumWidth = frustrumHeight * camera.aspect;
	Matrix4x4 mat = camera.projectionMatrix;
	mat[0, 2] = 2 * xOffset / frustrumWidth;
	mat[1, 2] = 2 * yOffset / frustrumHeight;
	camera.projectionMatrix = mat;
}

This is very useful for shaking the whole screen! I recommend you generate the x and y offsets using perlin noise to achieve a more natural shaking effect.

Please post a comment if you have any questions! And thanks a lot everyone who helped me out. :slight_smile:

You could move the vanishing point:

http://wiki.unity3d.com/index.php?title=OffsetVanishingPoint

by changing Camera.rect x and y you would shake the whole rendered frame - note that u will have borders around the surface, you would probably have the surface a little bigger than the screen and keep your shakings in that range so no borders get visible