I am trying to make a cutscene work however it keeps erroring. I have checked if the parts are in the right places, but it still isn’t working. So, alas, I come to devforum for the first time in almost half a year to ask the simple question of what the **** is going on with my script.
What The Error Says:
20:37:31.523 Cframe is not a valid member of Part "Workspace.QuickTrainSteps.Camera2" - Client - LocalScript:23
20:37:31.523 Stack Begin - Studio
20:37:31.523 Script 'Players.NotAid_n.PlayerGui.LocalScript', Line 23 - function Tween - Studio - LocalScript:23
20:37:31.523 Script 'Players.NotAid_n.PlayerGui.LocalScript', Line 33
The script:
local QTS = game.Workspace.QuickTrainSteps -- Quick Training
local NTS = game.Workspace.NormalTrainSteps -- Normal Training
local TweenService = game:GetService("TweenService")
local Camera = game.Workspace.Camera
local CT = 12 -- Time it takes for the cutscene to happen (so it doesn't go on forever)
local tweenInfo = TweenInfo.new( -- determines cutscene style
CT, -- time it takes
Enum.EasingStyle.Sine, -- Easing Style of the cutscene transition
Enum.EasingDirection.Out, -- Easing Direction of the cutscene transition
0,
false,
0
)
function Tween(part1,part2)
Camera.CameraType = Enum.CameraType.Scriptable -- Makes Camera Scriptable
Camera.CFrame = part1.CFrame
local Tween = TweenService:Create(Camera, tweenInfo, {CFrame = part2.Cframe})
Tween:Play()
-- Create and play tween
wait(CT)
-- Wait for cutscene time
Camera.CameraType = Enum.CameraType.Custom -- CameraType after tween (Part2)
end
wait(2)
Tween(QTS.Camera1,QTS.Camera2) -- Camera Movement #1