EZ Camera Shake ported to Roblox

I’ve been having the same exact problem, I could not t find any way to replicate this issue and I just don’t know how to fix it.

1 Like

Oh my god, how did you port this??
Anyways, i’ve given you a “shoutout” on my latest module. It works best with yours, sooo…
Anyways, thanks for this!

I feel like this is what happens when 1000 people hit you with Error in Slap Battles

Anyways, I dont think so for me. I’ll try it later and see what happens. But I think you should just use “CameraOffset” for now.

Does anyone know how to make the camera shake with a remote event with a tuple that says which preset is meant to be used?

fire the remote with

remote:FireClient(player, CameraShaker.Presets.Explosion)

and then have the client do

remote.OnClientEvent:Connect(function(preset)
      camShake:Shake(preset)
end)
3 Likes

I used this in unity and it works just as well in Roblox. Really good stuff here.

2 Likes

atm this camera shake module isn’t user friendly bc its not so easy to understand how it works and how to use it

Not sure if this has been answered but I haven’t been able to find the answer.

How would I make the shake return to the origin mouse position as the shake ends the same way it shook away from the originally mouse position randomly?

it happens when ur frame drop… the shake adds up all at once once the frame isnt freezing anymore

1 Like

Looking to add this to my game but I have a custom camera that sets the CFrame of the camera already and is bound on RenderStep. If I increase the priority of the camera shake, it removes the custom camera I’m using.

1 Like

I had that same issue, what I ended up doing was adding a seperate variable called ShakeCFrame which the module changes, then multiplying that on top of the player input in the render step function

1 Like

Lmao yeah about 5 hours of playing around later, I came to roughly the same solution

1 Like

Is it possible to use the shake while the players camera’s cframe is being set to a location in a loop?
I’m making a cannon system where while your aiming your camera is stuck on the barrel and want to use this shake when fired. Thanks!

Nevermind, I can just pause the loop that sets the camera’s cframe while the shake happens.

perhaps to make those short bursts of movement blend smooth into each other, instead of random univariate noise which would have made them step-wise more likely

Are you willing to share the code for this?

1 Like

it only works locally due to localscripts having the ability to access the camera

very nice to see unity assets imported to roblox.

2 Likes

I am having an issue where this script:

function CameraShaker:ShakeOnce(magnitude, roughness, fadeInTime, fadeOutTime, posInfluence, rotInfluence)
	local shakeInstance = CameraShakeInstance.new(magnitude, roughness, fadeInTime, fadeOutTime)
	shakeInstance.PositionInfluence = (typeof(posInfluence) == "Vector3" and posInfluence or defaultPosInfluence)
	shakeInstance.RotationInfluence = (typeof(rotInfluence) == "Vector3" and rotInfluence or defaultRotInfluence)
	self._camShakeInstances[#self._camShakeInstances + 1] = shakeInstance --this line has the error
	return shakeInstance
end

returns the error “attempt to get length of a nil value” even though I used a cameraShaker.new() and a CameraShakeObject:Start() function in the camera shake wrapper module script:

local CameraShaker = require(script:WaitForChild("CameraShaker"))

local CurrentCamera = workspace.CurrentCamera

local CamShake = CameraShaker.new(Enum.RenderPriority.Camera.Value, function(shakeCFrame)
	CurrentCamera.CFrame *= shakeCFrame
end)

CamShake:Start()

Does anyone know how to solve this issue?

Nevermind, I solved it by changing the variable in the shaker wrapper module from the CameraShaker module to the camera shake object (CameraShaker.new() result)