humanoid:MoveTo() imprecise

I’m trying to make a system where the character moves to wherever. For customization purposes, I am not using the starter player ClickToMove functionality. Here’s my code

local humanoid = character:WaitForChild("Humanoid")
local root = character:WaitForChild("HumanoidRootPart")
	
local roundedValues = {targetPosition.X, targetPosition.Z}

for i, v in pairs(roundedValues) do
	roundedValues[i] = math.round(v / 5) * 5
end
targetPosition = Vector3.new(roundedValues[1], 0, roundedValues[2])
	
humanoid:MoveTo(targetPosition)


But as you can see, that is not at all where my root part ends up!
image
It’s practically half a stud off! This causes an extremely annoying uncenterd character.
image
Does anyone know why :MoveTo() is acting so imprecise? Are there any alternative ways to accomplish this without using the ROBLOX ClickToMove system?

As always, all replies are appreciated!

A half stud is a lot, but a workaround would be to nudge them via a tween using PivotTo once MoveTo completes. Do it fast and it won’t be noticed.

Also does the amount of the miss vary? Wondering if the walk animation is changing the root part position and causing MoveTo to stop at different points.

1 Like