A basic camera shake module

Hey guys! I made a super-simple camera shake module for you guys to use!

code:
https://www.roblox.com/library/6946735369/CameraShake
just put this in starter player scripts as a module script and require it.
to call it you do:

local camerashake = require(game.StarterPlayer.StarterPlayerScripts.CameraShake)
local Xstrength = 30
local Ystrength = 30
local Zstrength = 30
local camerashaketime = 30
camerashake.new(Xstrength,Ystrength,Zstrength,30)

Note: The lower the strength number the the more intense the camera shake will be.
Ex. If you put it to 1 It’ll be very intense and partially glitch your camera for the duration.

video demonstration:

Hope you guys like it(Also It’s my first ever module I made)

Give me some feedback!

25 Likes

I like this module. It is written in a few lines, and it is very straightforward. Also, it might be better to wait for RenderStepped instead of having a wait statement. This can be done by replacing the wait() statement with game.RunService.RenderStepped:Wait().

2 Likes

Actually that gives an error:

RunService is not a valid member of DataModel “Classic Baseplate”

instead I’m going to use

game:GetService("RunService").RenderStepped:Wait()

Oops I forgot. If you access RunService as a member of game, it has a space in it (for some reason).

game["Run Service"].RenderStepped:Wait()

But Getting the service through GetService is probably better since it creates the service if it does not exist.

2 Likes

Can you put the script on sale? I can’t buy it on roblox for some reason

2 Likes

I think I just fixed it, press the module again on the post, I updated the link

So how would I get a very slight effect?
Sorry for the bump but this module is pretty cool and I’m using it for a recreation of V.4

Sorry for the late response, I haven’t been on the devforum for a while. But the higher the numbers the less intense it is so if you wanted a small shake you would put it to a high number

this doesnt work it just gives a error with attempt to index nil with “Character”

You didn’t changed it?
And did you tried the example script?
For me, it’s working totally fine (By the way, be sure you require in a local script, not a server script, because camera shake is a client effect)

ive made a completely new one and it now works!

1 Like

That’s a pretty simple camera shake, i know that this is 1 year ago, but i don’t want the realistic camera shake (why you may ask? because i actually like this ones that are simple) which means that this could be good! Great work :slight_smile:

1 Like