"Unable to cast directionary" error when tweening a part

hello, i’m having trouble tweening a part. i’ve tried multiple solutions, but have always gotten the “Unable to cast directionary” error. please help

here’s my script

local ts = game:GetService("TweenService")
local info = TweenInfo.new(
	3,
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.InOut,
	0,
	false
)

local candmgmain = false

script.activated.OnServerEvent:Connect(function()
	local part = game.ReplicatedStorage.bossabilities.meteor:Clone()
	part.Parent = workspace
	part.Transparency = 0
	part.Position = Vector3.new(-46.39, 150, -83.17)
	
	local goal = {Position = -46.39, 12.732, -83.17}
	
	local tween = ts:Create(part, info, goal)
	
	candmgmain = true
	tween:Play()
	task.wait(3.1)
	
	task.wait(7)
	
	part.Touched:Connect(function(hit)
		if candmgmain == true and hit.Parent:FindFirstChild("Humanoid") then
			local hum = hit.Parent.Humanoid
			local damage = math.random(50,80)
			local candmg = true
			
			if candmg == true then
				hum:TakeDamage(damage)
				candmg = false
			end
		end
	end)
	
	candmgmain = false
	repeat
		part.Transparency += 0.05
		task.wait(0.1)
	until part.Transparency == 1
	part:Destroy()
end)
1 Like

Position has to be a vector3.new thing, just change that to:

	local goal = {Position = Vector3.new(-46.39, 12.732, -83.17)}

1 Like

I think you should do:

local goal = {Position = Vector3.new(-46.39, 12.732, -83.17)}
1 Like

Whenever you’re moving a part you always want to use Vector3.new before making the value.

local goal = {Position = Vector3.new(-46.39, 12.732, -83.17)}

That one line should fix your issue.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.