I’m making a script that plays a cutscene in my game and continues the cutscene when the player presses any key or button. The problem is that the tween which switches between cameras depending on the text displayed on the screen doesn’t work. The print states that the Tween is successfully completed each time.
Any help on this matter would be much appreciated.
cam.CameraType = "Scriptable"
while NextTut < 7 do
wait()
UIS.InputBegan:Connect(function(input, gameprocessed)
if input.UserInputType == Enum.UserInputType.Keyboard or input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.MouseButton2 or input.UserInputType == Enum.UserInputType.Touch then
if NextTut < 7 and debounce then
debounce = false
wait()
print(tostring(NextTut), SpeechText.Text)
NextTut += 1
SpeechText.Text = SpeechTable[NextTut]
if NextTut == 2 or 3 or 4 then
local tween3 = TweenService:Create(
cam,
TweenInfo.new(2,
Enum.EasingStyle.Sine,
Enum.EasingDirection.Out),
{
CFrame = TutCamPositions[NextTut]
}
)
tween3:Play()
tween3.Completed:Connect(function(playbackState)
print("tween1: "..tostring(playbackState))
end)
tween3.Completed:Wait()
end
debounce = true
wait()
end
end
end)
end