How can i set this up?
I’m not experienced with module scripts at all.
Woah very smooth and useful. Thanks!
This is a very nice system to work with. Very advanced, very smooth. I’ve been using this since 2019!
Wait what?
I do that cause of readability and I thought it helped with performance in a minor way, can you send a screenshot of this minor performance penalty, and is it safe to assume that local wfc = game.WaitForChild would incur the same minor performance penalty or more?
It used to help with performance, but Luau changed some things so that this isn’t the case. See Luau page common Lua tricks of caching the method in a local variable aren’t very productive in Luau and aren’t recommended either
(table access to Vector3 may also be faster iirc, not an expert).
Your wfc thing is just the same principle, and should no longer be used. (call as a method instead)
Thank you that’ll be helpful in the future just that I’ve done some testing and found that local v3 = Vector3.new will impact performance 1/5 times while v3 = Vector3.new will be the one to impact it the most 4/5.
With this information I’ll be using local v3 instead of Vector3.new because of readability and that slight performance gain, the links below show the tests I’ve tested it over 30 times now and it always lead to this 1/5.
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?