How would I make my fps script more smooth

My script works just need it way more smooth in first person any help?

local runService = game:GetService("RunService")
local camera = workspace.CurrentCamera

runService.Heartbeat:Connect(function(deltaTime)
	local camframe = game:GetService("Workspace").CurrentCamera.CFrame
	script.Parent.PrimaryPart.CFrame = camframe + camframe.LookVector * 0 + camframe.UpVector * 0 + camframe.RightVector * 0
	script.Parent.PrimaryPart.CFrame = script.Parent.PrimaryPart.CFrame:Lerp(camframe, 0.0001)
end)
1 Like

Why are you setting the CFrame of the model’s PrimaryPart to 2 different values?

Oh that makes it a little more smooth but I need something more smooth.

Also why are you multiplying camframe.LookVector * 0?
Anything * 0 is 0

thats if I want to change it this is not about that this is about the smoothness

RenderStepped will make it smoother. But note that RenderStepped is per frame, so that must be taken into account if you’re worried about how quickly something will run.

2 Likes

WOW that worked super well! (30)

Just a comment on this calculation even though @MightyDantheman solved your issue.

You are making more unnecessary calculations every Heartbeat (or RenderStepped) when the script runs and that will slow things down as well.
The above line just calculates to:
script.Parent.PrimaryPart.CFrame = camframe with 3 extra calculations that always equal 0 added to it.