When the Parent block moves closer to the Locations the block slows down as it gets closer, is there any way for this to work as constant speed?
If anything I'm pretty sure it's to do with the way I've lerp'd it but I'm honestly not too sure.
local self = script.Parent
local Folder = game.Workspace.Locations
self.Parent = game.Workspace.Enemies
local locations = {
Folder.Location1,
Folder.Location2,
Folder.Location3,
Folder.Location4,
Folder.Location5,
Folder.Location6,
Folder.Location7,
Folder.Location8,
Folder.Location9
}
for i,v in pairs (locations) do
local targetLocation = v
while((self.Position-targetLocation.Position).magnitude >= 0) and wait() do
self.CFrame = self.CFrame:lerp(targetLocation.CFrame, 0.01)
self.CFrame = CFrame.new(self.CFrame.p, targetLocation.CFrame.p)
end
end
