This is what I have not sure how to make it all work together the part moves perfectly toward everyway point but I just need it to face the one it is heading towards… … also once the part makes it all the way around it stops for the amount of (Time) is, I’d like to just continue without any stopping. Time also controls the speed so is there a way to separate the speed of the part using this TweenInfo and the time it moves around to each waypoint?
local balloon = script.Parent
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(
1, -- Time
Enum.EasingStyle.Linear, -- Easinmg Style
Enum.EasingDirection.Out, -- Easing Direction
0, -- Repeat Count
false, -- Reverse
0 -- Delay Time
)
local CFrames = {
workspace:WaitForChild("Waypoints"),
workspace["Waypoints"]:WaitForChild("waypoint 2").CFrame,
workspace["Waypoints"]:WaitForChild("waypoint 3").CFrame,
workspace["Waypoints"]:WaitForChild("waypoint 4").CFrame,
workspace["Waypoints"]:WaitForChild("waypoint 1").CFrame,
}
local i = 0
while true do
i = (i-1)%#CFrames + 2
local nextCFrame = CFrames[i] -- CFrame you want it to set
local tween = TweenService:Create(balloon, tweenInfo, {
["CFrame"] = nextCFrame
})
tween:Play()
tween.Completed:Wait() -- wait for it to complete
end
local blimp = game.Workspace.GameMap.Blimp
local position = blimp.CFrame.Position
local startPosition = Vector3.new(position)
local targetPosition = CFrames
blimp.CFrame = CFrame.new(startPosition, targetPosition)
local rotatedCFrame = CFrame.Angles(math.rad(-90), 0, 0)
blimp.CFrame = blimp.CFrame:ToWorldSpace(rotatedCFrame)