Need help to make this camera smoother

Hi if you are reading this, helping out would be great! In the video below, the camera works, however, the camera’s movement is a bit laggy and its very annoying. Is there a way to make the camera smoother?

Here is the code I used:

local camera = script.Parent

function giveCamera (player)
 if player then
  local character = player.Character
  if character then
   local humRootPart = character.HumanoidRootPart
   local bodyPos ="BodyPosition", camera)
   bodyPos.MaxForce =, math.huge, math.huge)
   local bodyGyro ="BodyGyro", camera)
   bodyGyro.MaxTorque =, math.huge, math.huge)
   while wait() do
    bodyPos.Position = humRootPart.Position +, 2, 3)
    bodyGyro.CFrame = humRootPart.CFrame


wait() doesn’t wait for 0 seconds, it waits for approximately 0.033 seconds, or 1/30th of a second. You can test exactly how long it takes (it varies) by pasting this to the command bar in Studio:

local t0 = tick(); wait(); local t = tick(); print(t - t0)

If your PC is good enough, Roblox can run at up to 60 fps, so if you update every wait(), you’ll be updating at half the maximum fps. The easiest alternative to wait() that runs at 60 hz is RunService.RenderStepped. So you can change the while loop to this:

while RunService.RenderStepped:Wait() do

Just make sure you define RunService at the top of the script.

1 Like

It works however, the camera is now not following the player. Instead of the humanoid root part its going to a random spot near the middle of the baseplate.

The inconsistency in the camera’s movement may be because you’re applying a force to the camera to move it around, rather than adjusting the CFrame/Position of the camera relative to the character.

For smoothness of movement, consider using tweening.

1 Like