Humanoid:MoveTo stopping before part

I’m using Humanoid:MoveTo and it would stop RIGHT before getting to its exact location.
Screenshot (292)
It stops right before and then goes to the next one. I’m just doing humanoid:MoveTo(part.Position)
Screenshot (293)
You can see it going to the next part at an angle.

1 Like

Because PathfindingService only finds paths the shortest to the route.

You can add a humanoid.MoveToFinished:Wait()

or you can mess around with agent parameters. Here is the documentation:

Scroll down to Create Path Section and you should find a ton of information regarding the AgentParameters.

1 Like

I’m not using PathFindingService

1 Like

MoveTo only works for 8 seconds, if the target/part is too far, it will stop without reaching the target, you need to continuously be calling MoveTo to overwrite the timing

2 Likes

Why not???

All npc movement should be used with pathfinding service??

It’s more reliable using it. But if you insist, try adding a humanoid.MoveToFinished:Wait() and see if that works?

1 Like

I have code that bypasses the 8 second limit and the problem still happens.

1 Like

Humanoid:MoveTo(part.Position) isn’t pathfinding service.

1 Like

You MUST be continuously calling it, do you mind if i check the code too?

1 Like

Im not saying it is, but I would try switching to pathfinding service, unless your doing something crazy advanced.

1 Like
	local pathPoints = map.PathPoints
	for point = 1, #pathPoints:GetChildren() do
		local pointPos = pathPoints[point].Position
		repeat
			humanoid.WalkToPoint = pointPos
			humanoid.MoveToFinished:Wait()
		until (mob.HumanoidRootPart.Position - pointPos).Magnitude < 1.5
	end

the dummy is small so the Magnitude is lowered.

1 Like

Okay, maybe you could try lowering the Magnitude a bit more.
and try using MoveTo.

humanoid:MoveTo(pointPos)
humanoid.MoveToFinished:Wait()
1 Like

The magnitude doesnt matter as it stops even on paths that dont last 8 seconds. I have tried MoveTo and same result.

Also, putting the magnitude any lower would just make it think it can NEVER reach its destination.

1 Like

Screenshot (294)
Stops right before reaching it.

1 Like

I mean like this looks like, its already 1.5 mag between them both.

1 Like

Even if I change the magnitude it stops at the same exact place. Or goes to the next one at the same exact place. That means the magnitude has nothing to do with it.

1 Like

I disagree, depending on the magnitude it will determine where the dummy is going to stop.

1 Like

I tested it, you literally can’t disagree.

1 Like

I changed the code and the problem persists. The magnitude had nothing to do with it.

repeat 
	humanoid:MoveTo(pathPoints[point].Position)
until(humanoid.MoveToFinished:Wait())
1 Like

Okay so try this.

local pathPoints = map.PathPoints
for point = 1, #pathPoints:GetChildren() do
    local pointPos = pathPoints[point].Position
    humanoid:MoveTo(pointPos)
    humanoid.MoveToFinished:Wait()
    while (mob.HumanoidRootPart.Position - pointPos).Magnitude > 1.5 do
        humanoid:MoveTo(pointPos)
        humanoid.MoveToFinished:Wait()
    end
end
1 Like

The problem stayed. CHARACTER LIMIT