So basically my script has a part that will act like a camera. But whenever the player moves the camera moves roughly. How can I make it so that the camera moves smoothly? Script is located in StarterCharacterScripts
local currentCam = game.Workspace.CurrentCamera
local camPart = game.Workspace.Cam
local player = game.Players.LocalPlayer
local character = player.Character
currentCam.CameraType = Enum.CameraType.Scriptable
repeat wait()
currentCam.CameraType = Enum.CameraType.Scriptable
until currentCam.CameraType == Enum.CameraType.Scriptable
currentCam.CFrame = camPart.CFrame
while wait() do
currentCam.CFrame = camPart.CFrame
camPart.Position = character.Head.Position + Vector3.new(0, 0, 20)
end
Also if you can could you please explain it to me.

8 comments
i think you need to use something called renderstep instead of wait bc it runs every new frame or something like that. i dont know much about it but let me see if i can find a link to something that could help
https://developer.roblox.com/en-us/api-reference/event/RunService/RenderStepped
Oh I see thank you!
np if you dont need any more help with this i can post an answer for you to accept
unless you holding out for someone giving you a little more direction on how to implement this into your script?
It works like a charm thanks
For future reference, if you ever have a solution from somebody that works, you can accept their answer if they've posted it as an answer, or add [Solved] to the question title to indicate that the issue has been solved if it was a comment. It would be appreciated by the commenter if you've upvoted their comment
ok