Why is it firing .MoveToFinished early? I tried messing around with the character because it was scaled but nothing worked, it never reaches the point fully.
just add a small delay after it, it probably just only looks like its firing to early
Is MoveToFinished being fired on the server? If that’s the case then it’s probably server-client delay
maybe add an offset and/or check the reached boolean in the moveToFinished
Is the red spot the point that is targetted by the script? Maybe it’s center of mass is not where you want it to be, or maybe there is some collision blocking the NPC
Every part you see other than the enemies has cancollide and cantouch as false
local Rig = script.Parent
local Humanoid = Rig:WaitForChild("Humanoid")
local Start = workspace.Start
local End = workspace:FindFirstChild("end")
local Next = workspace:FindFirstChild("next")
Rig:PivotTo(Start.CFrame)
local dirToEnd = (End.Position - Rig:GetPivot().Position).Unit
Humanoid:MoveTo(End.Position + dirToEnd * 1)
Humanoid.MoveToFinished:Connect(function(reached)
if reached then
task.wait(1)
local dirToNext = (Next.Position - Rig:GetPivot().Position).Unit
Humanoid:MoveTo(Next.Position + dirToNext * 1)
end
end)
what if you used something like this
the delay itself isn’t the core issue here. since MoveTo is set to a fixed position, adding a delay won’t really change the outcome.
one alternative would be to continue moving the character in the same direction until MoveToFinished fires, plus a small custom delay. However, I wouldn’t recommend this approach, as it can easily cause the character to overshoot and move past the waypoint
What I would test instead:
Experiment with the waypoint positions. Try placing them slightly below the floor or higher above the ground. Humanoid.MoveToFinished fires when the character is considered close enough to the target position, so it’s possible that the engine is detecting this earlier than expected and firing the event. (its not wrong, you did reach the position in a way, just not fully on it)
also try printing if it did actually reach the waypoint or maybe it was timed out
print(Enemy.Humanoid.MoveTo:Wait() -- true = reached
-- false = not reached
I added an offset based on the scale of the character but its still not fully correct when changing scales
External MediaIt could be because the goals’ pivots are not exactly positioned in the centre of the object. Parts obviously don’t have pivots but I hope you know what I mean like the little white circle thing that’s on a part when you hover over it with the mouse.
I don’t recommend you use movetofinished or humanoid moveto at all really. Problem is that you can only do humanoid moveto from the server-side which can lead to jittery NPCs.
The only way to fix that is to give network ownership of the NPC to the player. Which is very risky.
So I recommend tweening and using a tween.Completed event as your movetofinished. Which is much smoother and can be done client-sided.
Thats the center of mass, i’ve already mentioned it earlier but it seems like that wasn’t the issue
It should be otherwise there shouldn’t be anything wrong but still I recommend tweens over humanoid move to.
I was curious about this so I ran a little investigation.
Using this code, I simply made a rig move to a part and got your issue.
workspace.Rig2.Humanoid:MoveTo(workspace.Node.Position)
Normally we’d expect the NPC to be exactly on top of the part, specifically the HRP (PrimaryPart) lining up exactly with the center of the part (the position the NPC is moving to), but unfortunately that doesn not happen.
The docs did not specify anything about this so I looked at the following videos to see if this was normal:
- 17:52 https://www.youtube.com/watch?v=MSzs0ran6fE
- 1:11 https://www.youtube.com/watch?v=7R_wfikY_o4
- 2:51 https://www.youtube.com/watch?v=NkmHITKc_cI
- 15:49 https://www.youtube.com/watch?v=uF-BGGv6otQ
- 4:46 https://www.youtube.com/watch?v=dOso_mzh9ac
In case you don’t want to click through every link, I’ll just show my findings:
In each one of these screenshots from videos uploaded 10 months to 5 years ago, none of the NPCs finished their MoveTo() exactly on top of the position.
However, some videos did have the NPC land right on top.
My Verdict
I think this is just a natural quirk of MoveTo() as a result of how Roblox does things behind the scenes.
While I could be entirely wrong (so take it with a grain of salt), there may be some post out there that debunks the issue. After all, the most reliable way to know if this is an engine quirk is to hear from Roblox themselves, but the docs on MoveTo() don’t specify anything.
If your game doesn’t need precision in where MoveTo() finishes, then I wouldn’t really spend the time doing so. But if you wish, you could experiment with the following ideas:
- Use the
time = distance / speedformula to wait between each node. - Use a loop to check the distances between the NPC and each node and only continue once close enough.
In the end I’ve decided to script my own movement system so its more precise, thank you for this response!








