so i just want the gun recoil to not make my character not rotate or to not face random directions when its in first person
local RunService = game:GetService("RunService")
local Camera = workspace.CurrentCamera
local function shake(waits, magnitude)
local st = tick()
local connection
connection = RunService.RenderStepped:Connect(function()
local elapsed = tick() - st
if elapsed > waits then
connection:Disconnect()
Camera.CFrame = Camera.CFrame
return
end
local offset = Vector3.new(
(math.random() - 0.5) * 2 * magnitude,
(math.random() - 0.5) * 2 * magnitude,
(math.random() - 0.5) * 2 * magnitude
)
Camera.CFrame = Camera.CFrame * CFrame.new(offset)
end)
end
i know its the cframe that doing this but idk how i would make it move like this if i remove cframe