Pretty basic script, it’s just meant to sway the camera when you turn you’re camera. It however, doesn’t work. Any idea on why this is?:
-- Services --
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local Players = game:GetService("Players")
-- Player & Camera --
local LocalPlayer = Players.LocalPlayer
local Camera = workspace.CurrentCamera
-- Variables --
local turnAngle = 0
-- Lerp Function --
local function lerp(a, b, t)
return a + (b - a) * t
end
-- Camera Sway --
RunService:BindToRenderStep("CameraSway", Enum.RenderPriority.Camera.Value + 1, function(deltaTime)
local mouseDelta = UserInputService:GetMouseDelta()
turnAngle = lerp(turnAngle, math.clamp(mouseDelta.X, -6, 6), 6 * deltaTime)
Camera.CFrame = Camera.CFrame * CFrame.Angles(0, 0, math.rad(turnAngle))
end)