I was really confused while following one of AlvinBlox’s tutorials. Can I have an explanation to why this LocalScript is returning an error saying that it doesn’t have a number when it is defined above?
The exact error message is TweenInfo.new first argument expects a number for time.
local TweenService = game:GetService("TweenService")
local camera = game.Workspace.Camera
local custsceneTime = 10
local tweenInfo = TweenInfo.new{
custsceneTime,
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(custsceneTime)
camera.CameraType = Enum.CameraType.Custom
end
wait(2)
tween(game.Workspace.Test1,game.Workspace.Test2)