I’m using Humanoid:MoveTo and it would stop RIGHT before getting to its exact location.
It stops right before and then goes to the next one. I’m just doing humanoid:MoveTo(part.Position)
You can see it going to the next part at an angle.
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.
I’m not using PathFindingService
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
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?
I have code that bypasses the 8 second limit and the problem still happens.
Humanoid:MoveTo(part.Position) isn’t pathfinding service.
You MUST be continuously calling it, do you mind if i check the code too?
Im not saying it is, but I would try switching to pathfinding service, unless your doing something crazy advanced.
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.
Okay, maybe you could try lowering the Magnitude a bit more.
and try using MoveTo
.
humanoid:MoveTo(pointPos)
humanoid.MoveToFinished:Wait()
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.
Stops right before reaching it.
I mean like this looks like, its already 1.5 mag between them both.
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.
I disagree, depending on the magnitude it will determine where the dummy is going to stop.
I tested it, you literally can’t disagree.
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())
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
The problem stayed. CHARACTER LIMIT