CameraShakeUpdated - Simple camera/screen shaking module

This is CameraShakeUpdated, a module I made for camera/screen shaking done as simply as possible.

In my game, I had been using the module “EZ Camera Shake” by Sleitnick, which I came to find unreliable and outdated. This module is even simpler, with one .new() function to create a screen shake instantly. You can create shakes with custom values or use a custom or pre-made preset from the Presets file.

You can get the module here.

How to use :

  • Require the module (change path to where module is) as well as presets (optional)

      local CameraShake = require(ReplicatedStorage.CameraShakeUpdated)
      local CameraShakePresets = require(ReplicatedStorage.CameraShakeUpdated.Presets)
    
  • Create a custom camera shake instantly

      CameraShake.new(2.5, 3, 1.5, Vector3.new(1, 1, 1), Vector3.new(3, 1, 3), 0.2)
    
  • Create a camera shake from preset (see the “Presets” ModuleScript to add your own or edit)

      CameraShakePresets["Impact"]
    

Camera shake values:

  1. Magnitude (number)
    - How vigorous the shake will be; how far in each direction the camera can shake
    - Higher number, more strength
    - Try 2!

  2. Roughness (number)
    - Determines how “rough” the shaking will be
    - Higher number = smoother, lower number = sharper
    - The time, in seconds, each jut in a direction will take
    - Try 3!

  3. Duration (number)
    - How long the shake will last, in seconds

  4. PositionInfluence (Vector3)
    - How much the shake will affect each positional axis
    - Relative to world
    - Try Vector3.new(1, 1, 1)!

  5. RotationInfluence (Vector3)
    - How much the shake will affect each positional axis
    - Relative to world
    - Try Vector3.new(1, 1, 1)!

  6. FadeOut (number)
    - The amount the Magnitude will fade out by along the duration of the shake (subtracted each frame)
    - Higher number = faster fade out
    - Try 0.2!

[Example video]
(Watch Screen Recording 2025-04-21 at 8.49.57 PM | Streamable)

8 Likes

This is a great module, however I’m not sure if i’m calling the camera shake correctly.

This is how I’m calling it:
Screenshot 2025-04-23 10.52.42 AM

And this is the error it returns:

Just realized that CameraShaker.new() is to create custom presets, so I have absolutely no idea how to actually utilize the camera shake.

Edit: Nevermind I figured it out finally

Although you said you figured it out, this is because you use presets like functions. They aren’t a list of arguments for CameraShake.new but instead call upon CameraShake.new with the preset args.

Anyways thank you very much for using the module! Any suggestions?

(Also, this technically means that if you are only using presets you only need to require the presets module, not the main one.)