Camera Bobbing doesnt work with different FPS

I have and it works, but how would I use their solution in my script? I can see they are using math.clamp with deltatime and the smoothness variable however my code is setup alot different than theirs

The difference I see is with the lerp alpha, yours is 0.1.

Theirs is delta time multiplied with a factor of 60 and such.

1 Like

Could you show how you would do it in my script? it still doesnt seem to be working for me

camerabobcf = camerabobcf:Lerp(CFrame.new(),.1 * FPS) 

It makes sense to scale the alpha variable here, because you’re animating it back to its default or origin position, using the same value every time. So on higher frame rates it should work quite faster.

that just changes how the camera lerps back to normal, fps isnt really needed there
but i somewhat changed the full script and it still doesnt work

game:GetService("RunService").RenderStepped:Connect(function(FPS)

	if running then
		camerabobcf = camerabobcf:Lerp(CFrame.new() * CFrame.Angles(
			YAxis * math.sin(tick() * Speed )* (FPS),
			0, 
			XAxis * math.sin(tick() * Speed )* (FPS),
			0, 
			ZAxis * math.sin(tick() * Speed )* (FPS)) -- intensity * math.sin(tick() * speed))
			,.1) 
	else
		camerabobcf = camerabobcf:Lerp(CFrame.new(),.1 ) 
	end
	
	cam.CFrame = cam.CFrame
		* camerabobcf 
	--print(math.round(XAxis * math.sin(tick() * Speed )* FPS * 15))
end)