Error with tween service

Hi I am trying to tween apart when a UI button is pressed and it is giving errors
Local Script

local Info = {
		5,
		Enum.EasingStyle.Sine,
		Enum.EasingDirection.InOut,
		0,
		false,
		0
	}
	local namee = game.Workspace.camera_part
	local goal = {
		Position = Vector3.new(-161, 94.5, 26)
	}
	local move = tween_service:Create(namee, Info, goal)
	wait(1)
	move:Play()

Output

Unable to cast Array to TweenInfo 

The error is

local move = tween_service:Create(namee, Info, goal)

The 2nd argument of TweenService:Create is a TweenInfo object which you can create by using the following:

TweenInfo.new(data)

so to fix your problem your just need to change:

local Info = {
	5,
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.InOut,
	0,
	false,
	0
}

to…

local Info = TweenInfo.new(
	5,
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.InOut,
	0,
	false,
	0
)

Next time please search on any search engine before posting on scripting-support as when I searched on google it took less than a second to get the answer to what you needed

If you don’t find anything on your search engine then look at the api reference on the dev hub as well, it is very helpful and has lots of examples. For TweenService:Create the page is: TweenService | Roblox Creator Documentation

1 Like

Thank you so much really appreciated