A very simple camera shaking system for Roblox.
You can create a shaker object and add camera shake like this:
local SimpleShaker = --Wherever the module is.
local shaker = SimpleShaker.new()
shaker:Shake(3)Whenever you're done with a shaker, you can destroy it.
shaker:Destroy() --Destroys the shaker, immediately stopping all camera shake.
shaker:SmoothlyDestroy() --Destroys the shaker after all current camera shake finishes (prevents new camera shake from being added).You can customize how a shaker looks by passing a table of config values (these are the default values):
local shaker = SimpleShaker.new({
Frequency = 1, -- How fast the camera moves to different locations.
Amplitude = 0.5, -- How far the camera can rotate.
Decay = 2, -- How fast the shake goes away.
Camera = workspace.CurrentCamera, -- What camera to use.
})SimpleShaker respects Roblox's reduced motion setting by default.
You can disable this behavior:
SimpleShaker.RespectReducedMotionSetting = falseWe're open to contributions! Please keep in mind that SimpleShaker intends to be simple and lightweight, if theres a specific feature you need that goes outside of this project, consider forking!
If you find a bug, please open an issue first.