Anything wrong with this script?
local TweenSevice = game:GetService("TweenService")
local camera = game.Workspace.Camera
local cutsceneTime = 10
if workspace:FindFirstChild("CamPart1", "CamPart2") then
print("Both Parts Found!")
end
local Cam1 = game.Workspace.CamPart1
local Cam2 = game.Workspace.CamPart2
local tweenInfo = TweenInfo.new(
cutsceneTime,
Enum.EasingStyle.Sine,
Enum.EasingDirection.Out,
0,
false,
0
)
function tween(part1,part2)
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = part1.CFrame
local Tween = TweenSevice:Create(camera, tweenInfo, {CFrame = part2.CFrame})
Tween:Play()
wait(cutsceneTime)
camera.CameraType = Enum.CameraType.Custom
end
tween(Cam1,Cam2)
The script supposed to make it so when the player joins the game, it tween their camera so a cutscene appears. When cutscene is done the players camera is on them.
Here is the explorer
