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)