You can put it anywhere a LocalScript can access, since you have to require it from a LocalScript. Somewhere like ReplicatedStorage works fine.
Ok, Thanks!
A little late, sorry, but I came back to this after deciding to not work with the horribly unreadable (microoptimized lollllllllllllll) version I wrote (itâs also a singleton :C )
Whatâs the use of having roughMod and magnMod versus just updating the Magnitude and Roughness properties?
I donât remember, sorry. I pretty much translated this directly from C# to Lua without many modifications to the actual code logic. I might have some time tomorrow to look at it
Thank you for this! Looks VERY smooth!!!
This is really interesting. I really appreciate your efforts to bring easily accessible things from the more mainstream third party platforms to Roblox. I hope myself and others help continue that effort!
Just a normal half-day at work for Crazyman32
How do you even use this module?
I spent a good half hour trying to figure it out until I realized I needed to use camShake:Start() in order for any effects to run. Just look at his example code here and in the module.
Sorry, yeah I based the API exactly from the original C# code. I probably could have made it a little more intuitive for Roblox. Maybe Iâll make a modification sometime soon thatâs a bit easier to use!
It doesnât work if I try to tween while itâs active so I had to disable it.
I have moved the code to a GitHub repository. Feel free to make pull requests to improve the code or submit issues for bugs that you find.
Small necro bump here but, how does magnitude & roughness effect things? Iâve been playing around with the module for a few days and Iâm not really sure what magnitude & roughness controls/does.
Good question. Itâs basically amplitude and frequency.
Magnitude = Amplitude. The outputted vector will be scaled with the magnitude. Essentially you will have a larger radius of movement. Code.
Roughness = Frequency (kind of). The algorithm uses perlin noise to generate the random movements, and the speed at which it scans through the noise function is scaled by the roughness. Code.
With Robloxâs faster Lua VM, itâs unnecessary to cache table access like local V3 = Vector3.new
(doing so now incurs a minor performance penalty).
Since the code is on Github, you can submit a PR to fix it if youâd like. I wouldnât recommend spending time on it if you have better things to be doing though â the performance difference is likely very minimal.
I have a plane taking off cutscene, and Iâd like to make this as realistic as possible by including a minor shake effect. However, since the CFrame is already set every frame, will this mess it up? If so, how would I get around it?
Sorry for the necrobump but is there a way to make it so the camera shake is consistent with FPS? In the GIF below, when my FPS is ~400, the camera shake moves the screen a lot more while when my FPS is 30, it barely moves the screen.
Thatâs pretty strange, CameraShaker:Update scales based on time since last frame. Is the same problem present comparing say 30 fps to 60fps? I have never heard of having over 60 FPS in roblox forever, that sounds like something weird.
I believe the problem is still present even when comparing the shakes between 30fps and 60fps.
Iâm using an fps unlocker to get my fps over 60.