I realized that a Part in Roblox can not always be equivalent to it's Destination Part. So I was wondering if there was a way to Identify it part was near Destination Part or Detect has nearly stop moving because when I run the script below the Part does appear to stop moving to the naked eye but is always changing it's position slightly by very tiny digits. So can anyone help me with this problem I've encountered. Soldiers = Part Part2 = Destination, so you guys can know what I'm talking about.
while true do
wait()
if Soldiers.Position.X ~= Part2.Position.X then
if Soldiers.Position.X > Part2.Position.X then
Soldiers.Position = Soldiers.Position - Vector3.new(0.02,0,0)
end
if Soldiers.Position.X < Part2.Position.X then
Soldiers.Position = Soldiers.Position + Vector3.new(0.02,0,0)
end
end
if Soldiers.Position.Z ~= Part2.Position.Z then
if Soldiers.Position.Z > Part2.Position.Z then
Soldiers.Position = Soldiers.Position - Vector3.new(0,0,0.02)
end
if Soldiers.Position.Z < Part2.Position.Z then
Soldiers.Position = Soldiers.Position + Vector3.new(0,0,0.02)
end
end
if Soldiers.Position.X == Part2.Position.X and Soldiers.Position.Z == Part2.Position.Z then -- this part of the script is almost never fired unless on the rare event that it actually meets it's destionation.
print("oof")
break
end
end
