Problems with Tween Camera Cutscene

1.What do you want to achieve? I want to achieve a camera cutscene with only using scripts and not plugins.

2.What is the issue? The issue is that whenever I click the button, it won’t load cutscene.

3.What solutions have you tried so far? Tutorials didn’t help me and didn’t help me.

local TweenService = game:GetService("TweenService")

local camera = game.Workspace.Camera

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

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

	wait(cutsceneTime)

	camera.CameraType = Enum.CameraType.Custom
end

wait(2)

game.StarterGui.ScreenGui.TextButton.MouseButton1Click:Connect(function()
	tween(game.Workspace.Part1,game.Workspace.Part2,5)
end)

u should make the camera scriptable first:

camera.CameraType = Enum.CameraType.scriptable

1 Like

Before changing the camera’s CFrame you should make sure to set camera type to scriptable. (I believe fixed also works, but scriptable gives more choices.)

game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable

Also, I am guessing it is, but is the script a local script?

1 Like

The issue was the script was a bit wrong and the parent of the script should have been StarterPlayerScipts, thank for the help though