Hello! I am trying to make a simple cutscene that goes from brick to brick in my game for an intro, but its giving me the error “Unable to cast Dictionary to TweenInfo”.
I don’t know what this means, all I did was watch an alvinblox tutorial on how to do this because I’ve never experimented with the tween service before. Unfortunately for me, I think that tutorial is outdated, (or I wrote something wrong.)
Here’s my code:
local TweenService = game:GetService("TweenService")
local camera = game.Workspace.Camera
local cutsceneTime = 12
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
local p = game.Players.LocalPlayer
p.CharacterAdded:Wait()
tween(game.Workspace.Cutscene1Cam1, game.Workspace.Cutscene1Cam2)