Intro cutscene camera stuck when you join

Hello everyone!

I have been trying for a bit getting this cutscene to work when you join, however for some reason the camera gets stuck on the first part (named Test1) and stays there.
I want to have the camera to move from Test1 to Test2.

Script:

local TweenService = game:GetService("TweenService")

local camera = game.Workspace.Camera

local cutsceneTime = 5

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

function tween (part1,part2)
	camera.CameraType = Enum.CameraType.Scriptable
	camera.CFrame = part1.CFrame
	
	local tween = TweenService:Create(camera, tweenInfo, {CFrame = part2.Cframe})
	tween:Play()
	
	wait(cutsceneTime)
	
	camera.CameraType = Enum.CameraType.Custom	
end

wait(2)

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

Its on a LocalScript in the StarterGui

1 Like

CurrentCamera

local camera = game.Workspace.CurrentCamera
2 Likes

As @MdoxxxDSQa said, you should change the Camera to CurrentCamera because you want to change player’s current camera, not the camera instance itself.

Besides, you can change the “game.Workspace” to just “Workspace” so you make your script cleaner.

local camera = workspace.CurrentCamera

1 Like

I have just tried that but i still run into the same problem, the camera will still not move when i join.
I’m probably gonna try something else since this have annoyed me for a while now. But thank you anyway :slight_smile:

it’s

	local tween = TweenService:Create(camera, tweenInfo, {CFrame = part2.CFrame})

not

	local tween = TweenService:Create(camera, tweenInfo, {CFrame = part2.Cframe})

you spelled CFrame as Cframe, always pay attention to spelling