Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make the CurrentCamera go from point A to point B?

I would like than the camera heading to part named "B", how do I proceed?

repeat wait() until workspace.CurrentCamera wait()

local target1 = workspace:FindFirstChild("A")
local target2 = workspace:FindFirstChild("B")
local camera = workspace.CurrentCamera

camera.CameraSubject = target1 
camera.CameraType = Enum.CameraType.Scriptable

--local angle = 1

while wait() do 
	camera.CoordinateFrame = CFrame.new(target1.Position)
--	* CFrame.Angles(target2.Position)
--	* CFrame.new(target2.Position)
--	angle = angle + math.rad(.2)
end

Thanks for your response !

1 answer

✓ Accepted answer

Use Lerp:

for i = 0,1,0.01 do
wait(0.01)
camera.CoordinateFrame = camera.CoordinateFrame:lerp(target2.CFrame, i)
end

1 comment

0

Thanks you!!:)

This discussion is preserved as it was. New answers, comments, and votes are closed.