Ok so I´m trying to create a simple camerashake, I have tried a few scripts but all of them use humanoid.CameraOffset which I can´t use since the camera in my game is the view of a Part,
How could I make a somewhat smooth screenshake whithout using the humanoid?
Here´s the code of one of the script I was using:
local character = player.Character
local oldOffset = character.Humanoid.CameraOffset
local shakeIntensity = 3
for i = 0, shakeIntensity * 10 do -- use a value between 0 and 3 (shake intensity), you can also increase the iterations.
local offset = Vector3.new(math.random(-1,1), math.random(-1,1), math.random(-1,1))
character.Humanoid.CameraOffset = character.Humanoid.CameraOffset:Lerp(offset, shakeIntensity * 0.25)
RunService.Heartbeat:Wait() -- defined somewhere else in the script
end
character.Humanoid.CameraOffset = oldOffset
Oh ryt mb, I should have lyk about the dependencies. Anyways, here’s trove’s source code. They are all part of a utility package called RbxUtil by sleitnick, so they are other cool modules in there if you are interested. Also trove doesn’t have any dependencies so all should work fine.