Humanoid:MoveTo moves to wrong position after repeated calls, and gets incrementally worse

After a few calls to Humanoid:MoveTo(Vector3, Part), and around 30 calls to Humanoid:MoveTo(Vector3), the later call starts moving the humanoid to an incorrect position. As further calls are made the humanoid moves to a position that is further and further away from the requested position.

It happens 100% of the time, within 20 to 50 seconds.

I’ve placed a red marker to show the requested position:

Place file to reproduce the problem:

MoveProblem.rbxl (119.8 KB)

5 Likes

Thanks for the report! We’ve filed this internally and we’ll follow up here when we have an update for you.

6 Likes

Thanks, it’s a show-stopper for this game.

Thanks for your report. We have identified the issue and should have a fix coming out in the next several weeks. If you need a workaround for this issue before this happens you can fix it yourself by manually setting Humanoid.WalkToPart = nil before calling Humanoid:MoveTo.

Here is a snippet of your repro code with the work around for reference:

function moveTo(playerPart)
	if playerPart == nil then
		-- walk randomly around the court
		local x = math.random(xMin, xMax)
		local z = math.random(zMin, zMax)
		local targetPosition = Vector3.new(x, yPosition + 2,z)
		moveTargetMarker.Position = targetPosition
		npcHumanoid.WalkToPart = nil -- Work around here!
		npcHumanoid:MoveTo(targetPosition)
		local offset = targetPosition - courtSurface.Position
		print("Random moveTo(" .. tostring(offset) .. ")")
		return
	end
	
	npcHumanoid:MoveTo(playerPart.Position, playerPart)
	print("moveTo(" .. tostring(playerPart.Position) .. "," .. tostring(playerPart) .. ")")
	return true
end
7 Likes

Thanks very much, the work around is working well!

Apologies for the late reply, haven’t quite figured out the notifications.

I am in the process of checking over bug reports and following up on some bugs that haven’t received any activity in a while.
Is this issue still occurring or can you confirm that this bug has been resolved?

Thanks for following up.

The workaround still works, but the bug hasn’t been fixed. So it’s not resolved.

The fix for this bug has now been shipped, sorry for the delay!

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.