What is this tweenService error about?

Using this script:

local elevate = script.Parent
local Floor = game.Workspace.moveto.Position
local tween = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(2.0,Enum.EasingStyle.Sine,Enum.EasingDirection.Out,0,true,1)
local goal = {Floor}
local tweenAnimation = tween:Create(elevate.Position,tweenInfo, goal)

local function onTouch(otherPart)
	local model = otherPart.Parent
	if model:IsA("Model") then
		local humanoid = model:FindFirstChildWhichIsA("Humanoid")
		if humanoid then 
			tweenAnimation:Play()
		end
	end
end
elevate.Touched:Connect(onTouch)

Gives me this error:
Screen Shot 2020-11-12 at 11.40.05 AM

Explorer

Screen Shot 2020-11-12 at 11.40.15 AM

2 Likes

Why do you send position as the first parameter in the TweenService:Create() function. You have to send an object instead.

TweenService:Create(object, TweenInfo.new(number, ...), {Position = Vector3.new(x,y,z)})
1 Like

Assuming you want to tween the floor to a certain position it should be

local tweenAnimation = tween:Create(
    Floor, 
    tweenInfo, 
    {Position = elevate.Position}
)
2 Likes

Iā€™m trying to tween the Elevate part to the floor position, so basically switch those two values around?

1 Like

Yep, swap Floor with elevate and elevate with Floor.

1 Like