So basically, Im making a minigame and i want a part to move from 1 place to the other
local TweenService = game:GetService("TweenService")
local Start = game.Workspace:WaitForChild("Start")
local End = game.Workspace:WaitForChild("End")
local PartToMove = game.Workspace:WaitForChild("PartToMove")
local TweenInformation = TweenInfo.new(
0.5, -- Time
Enum.EasingStyle.Linear, -- EasingStyle
Enum.EasingDirection.InOut, -- Easing Direction
5, -- Repeat Count
true, -- Reverses to initial position? (true/false)
1 -- Delay between each tween.
)
--[[
local EndProperties = {
Position = Vector3.new(X,Y,Z)
}
local EndProperties = {
Position = End.Position
}
--]]
local EndProperties = {
Position = End.Position
}
local TweenToPlay = TweenService:Create(PartToMove,TweenInformation,EndProperties)
while true do
TweenToPlay:Play()
wait(6) -- After the Tween is finished it will stop for 6 seconds then replay.
end
The script above works besides 1 little thing, I want the part named End to move, But not by tweening just teleporting. When i do this, The moving part doesn't change, It continues from going from start to where End USED to be. How can i make it update?
(The script was made by JakyeRU on the Dev forums. https://devforum.roblox.com/t/how-do-i-make-an-object-move-from-one-point-to-another/263127/3 )
