Basically I have a part “Move” in game.Workspace and 3 points “Point1” “Point2” “Point3”
I have script to move a part between the 3 points, but for each point it slows down
I want it so that the moving Part retains the same speed, while following the path of point 2, but still slows down at point 3
local TweenService = game:GetService("TweenService")
local movePart = script.Parent
local point1 = workspace:WaitForChild("Point1")
local point2 = workspace:WaitForChild("Point2")
local point3 = workspace:WaitForChild("Point3")
local points = { point1, point2, point3 }
local tweenInfo = TweenInfo.new(7.5, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut) --,0, false, 0
local function moveToNextPoint()
while true do
for i = 1, #points do
local goal = { Position = points[i].Position }
local goalO = { Orientation = points[i].Orientation }
local tween = TweenService:Create(movePart, tweenInfo, goal)
local tween2 = TweenService:Create(movePart, tweenInfo, goalO)
tween:Play()
tween2:Play()
tween.Completed:Wait(0.5)
if i == 2 then
local targetCF = CFrame.new(points[i].Position) * CFrame.new(0, 0, 0)
movePart.CFrame = movePart.CFrame:Lerp(targetCF, 0)
end
end
end
end
moveToNextPoint()