How to make the camera loop?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want to achieve my camera GUI to loop

  2. What is the issue? Include screenshots / videos if possible!
    I dont understand how to make it loop.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I’ve tried looking around, but I havent figured anything out.

local TweenService = game:GetService("TweenService")

local camera = game.Workspace.Camera

local cutsceneTime = 10

local tweenInfo = TweenInfo.new(
	cutsceneTime,
    Enum.EasingStyle.Sine,
	Enum.EasingDirection.Out,
	0,
	true,
	0
)

function tween(Test1,Test2)
	camera.CameraType = Enum.CameraType.Scriptable
	camera.CFrame = Test1.CFrame
	
	local tween = TweenService:Create(camera, tweenInfo, {CFrame = Test2.CFrame})
	tween:Play()
	
	wait(0)

	camera.CameraType = Enum.CameraType.Custom
end

wait(2)

tween(game.Workspace.Test1,game.Workspace.Test2)

Thanks! Anything helps.

You must get a CurrentCamera
camera = game.Workspace.CurrentCamera

However it dosent loop? + the dev hub dosent tell me anything.

What do you mean by ‘loop’? 30

I want it to repeat. 30 reeeeee

CurrentCamera is a camera currently used by player.
Also I think you should change a values in TweenInfo
There’s options to repeat and reverse:

You mean you want the tween to repeat after it finishes?

Yes. I want the camera to keep moving inbetween camera parts.

Looping a Tween

This code sample includes an example of how a looped tween can be created.

A part is instanced in the Workspace, and a Tween is created using TweenService:Create that is set to animate it’s position along the Y axis. The looped effect is achieved by modifying the TweenInfo used in TweenService:Create. Specifically, when RepeatCount is set to be less than 0 the tween will play indefinitely. Also, setting Reverses to true will cause the tween to play in reverse once it has reached it’s destination. In combination this creates a looped effect.

The correct way to make a tween play indefinitely is to set RepeatCount to -1. Developers should avoid using large numbers (or math.huge) as a substitute as this is unstable and may stop working at any point.

local TweenService = game:GetService("TweenService")
 
local part = Instance.new("Part")
part.Position = Vector3.new(0, 10, 0)
part.Anchored = true
part.Parent = game.Workspace
 
local tweenInfo = TweenInfo.new(
	2, -- Time
	Enum.EasingStyle.Linear, -- EasingStyle
	Enum.EasingDirection.Out, -- EasingDirection
	-1, -- RepeatCount (when less than zero the tween will loop indefinitely)
	true, -- Reverses (tween will reverse once reaching it's goal)
	0 -- DelayTime
)
 
local tween = TweenService:Create(part, tweenInfo, {Position = Vector3.new(0, 30, 0)})
 
tween:Play()
wait(10)
tween:Cancel() -- cancel the animation after 10 seconds

Source:

Just make multiple tweens that each tween the camera to each corresponding camera part then