My :MoveTo is not finishing

The :MoveTo script is not completely my own

  1. What do you want to achieve? That my :MoveTo finishes

  2. What is the issue? Its not walking to the last points. BUT he walks to the first few points*

VIDEO:

  1. What solutions have you tried so far? I’ve tried looking but I couldn’t find anything

IDK if this is helpful information but before he walks to the other points he is playing a animation from ANOTHER script

:MoveTo script

--// Variables
local Dummy = script.Parent
local waypoints = workspace.waypoints

--// Loops trough waypoints
for waypoint = 1, #waypoints:GetChildren() do
	Dummy.Humanoid:MoveTo(waypoints[waypoint].Position)
	Dummy.Humanoid.MoveToFinished:Wait()
	print("Next point finished")
end

Other script:

--// Variables debounce
local waitSeconds = 1
local isTouched = false 

--// When tree is touched function
script.Parent.PrimaryPart.Touched:Connect(function(hit)
	if not isTouched then
		isTouched = true 
		if hit.Parent.Name == "Dummy" then -- Checks if the person who touches is a Dummy
			local animation = hit.Parent.AI.DestroyTree
			local humanoid = hit.Parent.Humanoid

			local destroyTreeAnim = humanoid:LoadAnimation(animation) -- Tree slapping animation

			for count = 0, hit.Parent.config.RepeatAnim.Value, 1 do
				destroyTreeAnim:Play()
				wait(2)
			end

			script.Parent:Destroy()
			
			wait(waitSeconds)
			isTouched = false
		end
	end	
end)

I hope someone can help!

I’ve never had good results from MoveToFinished. I’ve found that its normally a problem with the Y coordinate. Try smashing the Y coordinate of the position:

local pos = waypoints[waypoint].Position * Vector3.new(1,0,1)

I should of watched the video first, you have to keep repeating the moveTo call as well it will time out after so many secs if you don’t reach the position.

Thanks! After doing some googling I found something that helped!

:MoveTo() times out after 8 seconds. You just need to ensure that the destination can be reached within 8 seconds of the humanoid’s position.