I am trying to make a camera follow script that follows your humanoid root part. But what happens is that it doesn't even move at all. I want it to follow your character instead. Here's the code:
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded
local newpos = workspace.Part.Position
local lookvector = char:WaitForChild("HumanoidRootPart").CFrame.LookVector
game:GetService("RunService").RenderStepped:Connect(function()
repeat wait()
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
until
workspace.CurrentCamera.CameraType == Enum.CameraType.Scriptable
workspace.CurrentCamera.CFrame = CFrame.new(newpos - lookvector * 3, newpos + lookvector * 3)
end)
What am I doing wrong here? Help!

5 comments
@TheLumient Right, but I don't know how to make the camera follow the character while still being in the same position. That's what I'm here for.
@Infuriashon, I've edited the code. Let me know if this is what you'd like. It's best to have it go by CameraSubject when making it Scriptable in this case. That would make it much more easily managable.
@TheLuminent CameraSubject doesn't work when camera type is set to scriptable. https://developer.roblox.com/en-us/api-reference/property/Camera/CameraSubject
Ofcourse it doesn't work but you can set the value, correct?
Alongside that, the value can be used to determine where the camera needs to go.