Camera doesn't continue to focus on the part when the part moves

I’m new to camera manipulation so, I don’t really know why it isn’t doing this.

  1. What do you want to achieve?

I want that when the focusing part moves, the camera continues to focus on the moving part.

  1. What is the issue?

The camera just looks at where the moving part was and never tracks the part when it moves.

  1. What solutions have you tried so far?

I couldn’t find anything helpful about this.

local TweenService = game:GetService("TweenService")
local ProximityPrompt = game:GetService("ProximityPromptService")
local camera = workspace.CurrentCamera
local focusing = workspace.Focusing
local ending = workspace.Ending
local Moving = workspace.Moving
local clicker = workspace.ClicktoCFrame
local Player = game.Players.LocalPlayer

local InfoMoving = TweenInfo.new(5, Enum.EasingStyle.Linear, Enum.EasingDirection.In)
local InfoInterpolate = TweenInfo.new(2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)

local PTMoving = {
	["Position"] = Moving.Position
}
local PTInterpolate = {
	["CFrame"] = CFrame.lookAt(ending.Position, focusing.Position)
}

local TweenMoving = TweenService:Create(focusing, InfoMoving, PTMoving)
local TweenInterpolate = TweenService:Create(camera, InfoInterpolate, PTInterpolate)

local function onPromptTriggered()
	clicker.ProximityPrompt.Enabled = false
	camera.CameraType = Enum.CameraType.Scriptable
	TweenInterpolate:Play()
	

	wait(3)

	TweenMoving:Play()
end

ProximityPrompt.PromptTriggered:Connect(onPromptTriggered)

It might be because when you are getting the Position value in for PTMoving table, you are only getting the position of it once, and never again

So, I have to use the pairs loop function to make it work?

I can’t figure out any loop for it to work.

You can make 2 tweens, First is the one you showed in the video, Second is making a tween where the Camera is following the Part.

That’s my Idea.

It’s easy, i want to explain it to you but it will only get you into confusion if i did explain so I hope you got an Idea

Just tried it, It didn’t work.

the camera position, is it on a part? if it is then try making the position of that part move

Nevermind, i found out the answer by using the service RunService