Hey,
I need smooth first person camera shake function. I tried using many methods but I haven’t found any solutions yet. I know how to make smooth camera shake for 3rd person mode using CameraOffset but it doesn’t work with first person mode. Is there a way to do this?
Just providing this function that makes 3rd person mode shake but doesn’t work on first person mode.
local shakeIntensity = 2.9
local shakeSpeed = 0.3
local RunService = game:GetService("RunService")
local TweenService = game:GetService("TweenService")
local humanoid = player.Character:WaitForChild("Humanoid")
function shakeCamera()
local shakeOffset = Vector3.new(
math.random(-shakeIntensity, shakeIntensity),
math.random(-shakeIntensity, shakeIntensity),
math.random(-shakeIntensity, shakeIntensity)
)
local originalOffset = humanoid.CameraOffset
local currentTime = 0
local duration = shakeSpeed
while currentTime < duration do
local delta = currentTime/duration
humanoid.CameraOffset = originalOffset + shakeOffset * (1 - delta)
currentTime = currentTime + wait()
end
humanoid.CameraOffset = originalOffset
end
It’ll probably need tweenservice to make it smooth but like for example this is meant to be smooth without tweens.
I am looking for this kind of smooth shaking but in a first person mode, not in a 3rd person:
(This can be found from the other post:)