How can I rotate character without interrupting Humanoid:MoveTo()?

I’ve implemented a click to move system and am trying to make the player face my mouse even while it walks. I use the Humanoid:MoveTo() function to move it, and it seems to stop whenever I rotate the character. Here is my code:

uis.InputChanged:Connect(function(input,focus)
	if input.UserInputType == Enum.UserInputType.MouseMovement and not focus and not ishovering() then
		if mouse.Hit then
			local part = mouse.Hit.Position
			local hrp = game.Players.LocalPlayer.Character.HumanoidRootPart
			hrp.CFrame = CFrame.lookAt(hrp.Position, Vector3.new(part.X, hrp.Position.Y, part.Z))
		end
	end
end)

Any input is helpful.

1 Like

This is the wrong category, move it to #help-and-feedback:scripting-support
There is seem to be a AutoRotate properties in the character Humanoid, set it to false to see if it work.

3 Likes

Try changing the HumanoidRootPart’s position through a change in CFrame as well, instead of using the MoveTo function. This is another way to successfully move the character to the correct location.

1 Like