I got this script which makes a part move from “Destination 1” to “Destination 2”, however it appears to not move when there is another part present in the way, I don’t understand why.
Here's the hierarchy of the scripts and parts in the explorer
.
Here's the script ("Settings")
local moveDelay = 3
local topSpeed = 15
local hideDestinationBlocks = true
local mainFolder = script.Parent
local platform = mainFolder.MovingPlatform
local alignPosition = platform.AlignPosition
local positionList = {}
while true do
local lowest = {nil, math.huge}
for _, value in pairs(mainFolder:GetChildren()) do
if not value:IsA("BasePart") then
continue
end
local nameSplit = string.split(value.Name, " ")
if #nameSplit ~= 2 then
continue
end
local destinationNumber = tonumber(nameSplit[2])
if string.lower(nameSplit[1]) == "destination" and destinationNumber and destinationNumber < lowest[2] then
lowest = {value, destinationNumber}
end
end
if not lowest[1] then
break
else
table.insert(positionList, lowest[1].Position)
if hideDestinationBlocks then
lowest[1]:Destroy()
else
lowest[1].Name = "Destination"
end
end
end
alignPosition.MaxVelocity = topSpeed
alignPosition.Position = positionList[1]
platform.AlignOrientation.CFrame = platform.CFrame.Rotation
platform.Anchored = false
local currentIndex = 1
while true do
alignPosition.Position = positionList[currentIndex]
task.wait(moveDelay)
currentIndex = currentIndex % #positionList + 1
end
.
And here's a video of the block not going from position 1 to 2 (the big white blocks)
What can I do to make it so that the block “ignores” the other block and goes straight from “Destination 1” to “Destination 2”?