I was trying to make a repeating and tweening camera using while true do and tweeninfo. The current camera CFrame starts on the first camera and would switch into the second camera every 7 seconds with a tween and also on repeat.
local camera = workspace.CurrentCamera camera.CameraType = Enum.CameraType.Scriptable local tweenService = game:GetService("TweenService") function tween(part1, part2) local tweenInfo = TweenInfo.new(5,Enum.EasingStyle.Quad,Enum.EasingDirection.Out) local tween1 = tweenService:Create(camera, TweenInfo, {CFrame = part2.CFrame}) local tween2 = tweenService:Create(camera, TweenInfo, {CFrame = part1.CFrame}) while true do camera.CFrame = part1.CFrame tween1:Play() wait(7) tween2:Play() wait(7) end end tween(game.Workspace.Cam1, game.Workspace.Cam2)
In the Create
functions, you meant to type tweenInfo
instead of TweenInfo
for the 2nd argument. It references the TweenInfo
dictionary instead of your TweenInfo instance