This module is great, thank you!
This module is amazing… thanks!
Wow. This was super flexible and easy to add with my fighting attacks. I like the explosion preset the most as it’s most compatible with attacks that I make.
How do you make the camera shake when close to a part? The shake is more intense the closer you are to it.
The module seems to not work? I honestly dont know what im doing wrong
local EM = game.ReplicatedStorage.EssentialModules
local CameraShake = require(EM:FindFirstChild("CameraShaker"))
script.Parent.MouseButton1Click:Connect(function()
CameraShake:Shake(CameraShake.Presets.Vibration)
end)
Check out the example code inside the original post, which shows you how to do a shake.
You need to create a new CameraShaker object, and providing the function with a render priority and a function where you use the CFrame provided by the module.
Does this work in a server script im using the same script ur using but its not working
It’s the server, not local.
Keyword “local” there.
well It works in local scripts for me but not in server scripts
Basically it only works in local scripts, since the effect is purely local. You have to shake the screen for the client and that’s a local effect. Basically what you can do is hook a server script to a remote event which then tells a local script to shake the client’s screen.
Hey, I’ve used this camera shaker before and know the basics of creating the effect, but would I be able to make a shake(Like earthquake / sustain shake) increase in magnitude if it gets closer to a part?
I’m not allowed to give free scripts or I’ll get a strike, but here is an example:
while wait() do
local shake = cameraShaker:Shake(cameraShaker.Presets.Explosion)
local part = workspace.Part
local distance = (game.Players.LocalPlayer.Head.Position - part.Position)
shake:SetScaleMagnitude(distance/16)
end```
Has anyone else run into a problem where you can’t shake the camera if you are already setting the camera’s CFrame elsewhere in the script? In my instance I have a lock on camera that uses the Humanoid Root Part’s CFrame along with an offset.
When I set the camera.CFrame = insertCFrameHere, the camera shake no longer applies, and I’m not sure what to do
I discovered that Shaker:Shake(Presets.Bump) can range from light shaking, to rocking the whole screen for no reason, is there a way for me to fix this?
For some reason, the preset vibrate isnt sustaining for me, it goes away pretty fast
Edit: apparently you have to use module:ShakeSustain or something (Noted in the github)
yes im struggling with this too. Any solutions?
I solved it! I put the shakeCf into a CFrame Value:
local camShake = CamShaker.new(Enum.RenderPriority.Camera.Value - 1, function(shakeCf)
-- Camera.CFrame = Camera.CFrame * shakeCf
Data.shakeCf.Value = shakeCf
end)
and then i multiplied it by the Camera CFrame
* CFrame.Angles(0,math.rad(AngleY),0)
* CFrame.Angles(math.rad(AngleX),0,0)
* HeadOffset -- offset
* (character.Data.shakeCf.Value)
good luck bro!
Where is Data defined and what does it do?
Edit: Nevermind that question, Got it now, thanks
Edit2: lol scratch that, actually what is the “AngleY” and “AngleX”?
AngleY and AngleX are the position of the mouse. Its part of the Camera script. Data is where i store data for the character. Just a folder to put my values in.
Question: Can this work for a tornado or volcano erruption as well?
I wonder if you have a preset for a basic hit attack, but overall very useful module