Need help with smooth camera movement

I am making a camera script for my game, but don’t know how to make it smooth.

	for i = 0, 1, 1 - CAMERA_LERP_SMOOTHNESS do
		camera.CFrame = camera.CFrame:Lerp(
				(platform.CFrame * / 3).X, 0, (player.Position / 1.5).Z)).Position +
				(platform.CFrame * / 2).X, 0, (player.Position / 2).Z)).Position

if I added delay to the for – loop, it would start to lag.
Any idea how to smoothly lerp the camera?

Help appreciated!

1 Like

What do you want to achieve exactly? I am guessing that you want to interpolate the camera from one CFrame to another.

You can use this spring module ‘NevermoreEngine/Spring.lua at version2 · Quenty/NevermoreEngine · GitHub’ to smoothly interpolate the position and rotation of the camera if that is what you are looking for.

Here is a function that moves the camera to a certain CFrame smoothly over a certain amount of time in seconds.

local moveCamera = function(destination, moveTime)
   local camera = workspace.CurrentCamera
   camera.CameraType = Enum.CameraType.Scriptable
   local destination = {CFrame = moveTime}
   local tweenInfo =, Enum.EasingStyle.Linear)
   local cameraTween = game:GetService('TweenService'):Create(camera, tweenInfo, destination)

Note that if you want the camera to move from one place to another, you will need to set the camera CFrame beforehand and then run that function. You can modify the function to what you would like it to be. If you want, you can change the EasingStyle to Enum.EasingStyle.Quad, but I find that Linear works best for the camera.

I hope this helps! :slight_smile:


That’s clever. Well written. I actually didn’t know about the order there so I appreciate it

1 Like

No, I am trying to make a smooth camera that moves behind a part, but when the part stops, it takes time for the camera to slow down.

Oh, so it follows the part but instead of following it perfectly it kinda lags behind smoothly?

Yeah, something like that. Just imagine as if the camera were a helium baloon attached to the part. It would be a bit behind the part and when the part stops it would keep on moving forward for a few seconds.

Just lerp it an add a little delay so it’s smooth using :Lerp() function of a CFrame

:Lerp(GoalCFrame, TimeToLerp)

How would I lerp it seamlessly every frame though?

I really have no idea how to do it.

RS.RenderStepped:Connect(function(deltaTime) -- use deltaTime if you want it to depend on player FPS
    workspace.CurrentCamera.CFrame:Lerp(workspace.CurrentCamera.CFrame, .2)

BE warn tho I am not sure this will work but try!

Okay, I will try it and let you know if it works.

1 Like

Doesn’t work :confused: Would it be okay to use TweenService?

I would go with @Brickman808’s method.


Take a look at the comments in the code snippet below~

local Spring = require(script.Spring) 
local RunService = game:GetService("RunService")

local part = game.Workspace:WaitForChild("Part")
local camera = game.Workspace.CurrentCamera

    Initialise the spring and set it's dampening and speed value to some value.
local spring =
spring.d = 10 -- Dampening
spring.s = 5 -- Speed

    Update function sets the spring target to the part's current position, and 
    adds some offset so the camera isn't sitting directly inside of the part.
    Sets the camera CFrame to the current position of the spring.
local function update()
	spring.t = part.Position +, 2, 10)
	camera.CFrame =

    Connect update function to RenderStepped so that the camera is updated 
    each frame.

Here is an open-source spring module you can use:
Spring.lua (3.2 KB)

This doesn’t take into account the orientation of a part, only the position, but it’s a jumping off point for you.


Okay, thanks! I will try it later.