TweenService & ClickDetector Help

I wanted to animate a moving part to a node (Part1 in this instance) using TweenService when a ClickDetector is pressed. The script generally works but the part moves in a totally different direction from the node. Any help would be appreciated!

local Stage1 = script.Parent.ClickDetector
local Stage2 = game.Workspace.Reset.ClickDetector

-- Part Variables
local main = game.Workspace.Platform
local Part1 = game.Workspace.Part1
local Part2 = game.Workspace.Part2

-- Tween Service
local tweenSerivce = game:GetService("TweenService")
local courseA = TweenInfo.new(
	2,
	Enum.EasingStyle.Linear,
	Enum.EasingDirection.InOut,
	0,
	false,
	0
)

local course1 = tweenSerivce:Create(main, courseA, {Position = Vector3.new(Part1.Position)})

-- Moving Part
local function setClick(player)
	course1:Play()
end

Stage1.MouseClick:Connect(setClick)
1 Like

you could try using CFrame instead of vector3

local course1 = tweenService:Create(main, courseA, {CFrame = Part1.CFrame})

1 Like

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