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.