I need help in figuring out how to smoothen the camera CFrame

I need help in figuring out how to smoothen the camera CFrame

The first one is what I want to achieve but I want it to move smoother

cam.CFrame = cam.CFrame * CFrame.Angles(0, 0, math.rad(-7))

This is the second one where I tried making it smooth

TS:Create(cam, AimTween, {CFrame = cam.CFrame * CFrame.Angles(0, 0, math.rad(-7))}):Play()

this is the AimTween and cam

local cam = workspace.CurrentCamera
local AimTween = TweenInfo.new(
	0.3,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.InOut,
	0,
	false,
	0
)

I tried everything I could do but I just couldn’t figure it out

Use lerp.

Note: using lerp on any RunService event will make it move faster or slower depending on fps, to fix it do this

local RunService = game:GetService(“RunService”)

RunService.Stepped:Connect(function(DeltaTime))
YourCFrame:Lerp(SomeOtherCFrame, 1 - 0.001 ^ DeltaTime) – Change 0.001 for different speeds (lower values = faster, higher values = slower)
end

2 Likes