Error with Tweeninfo

I want to make a cutscene but the code doesn’t work. This is the code

local CSParts = workspace.CutsceneParts
local partA = CSParts.PartA
local partB = CSParts.PartB
local partC = CSParts.PartC
local partD = CSParts.PartD
local partE = CSParts.PartE
local partF = CSParts.PartF
local TweenService = game:GetService("TweenService")
local Camera = workspace.Camera

local function Cutscene(duration,easingdirection,startPart,EndPart)
	
	local info = TweenInfo.new{
		duration,
		Enum.EasingStyle.Sine,
		easingdirection,
		0,
		false,
		0
	}
	
	Camera.CameraType = Enum.CameraType.Scriptable
	Camera.CFrame = startPart.CFrame
	
	local cutscene = TweenService:Create(Camera, info, {CFrame = EndPart.CFrame})
	cutscene:Play()
	wait(duration)	
end

wait(10)
Cutscene(5,Enum.EasingDirection.In,partA,partB)

I get the error: Tweeninfo.new first argument expects a number for time, but I give a number at the end of the script. It would be great if someone could help me.

It appears that you’re using curly brackets {} for your TweenInfo.new. Try replacing it with parentheses () and try again.

4 Likes

Here is an API reference for TweenInfo:

And @CoderCrazy is correct, regular brackets are used for TweenInfo.

1 Like

Thank you! it worked.
[30 chars]