✓ Accepted answer
local function makeWaypoints(pos1, pos2, amount)
if typeof(pos1) == "Vector3" and typeof(pos2) == "Vector3" then
local waypoints = {}
local pos1 = pos1
local pos2 = pos2
local amount = amount or 4
local magnitude = -((pos1 - pos2).Magnitude) / amount
local lastCF = CFrame.new(pos1, pos2) * CFrame.new(0, 0, -magnitude)
for i = 1, amount + 1, 1 do
lastCF = CFrame.new(lastCF.Position, pos2) * CFrame.new(0, 0, magnitude)
table.insert(waypoints, lastCF.Position)
end
return waypoints
end
end
pos1 should be set to the position you want to start from,
pos2 should be set to the end position,
amount should be set to the amount of waypoints you want.
To get the waypoints loop through the table that makeWaypoints returns.
2 comments
Thank you so much!
Does it work properly?