The issue is that the mouse is hitting the rig instead of the ground. You can remedy this by adding a filter to the mouse:
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local rig = workspace.Rig
mouse.TargetFilter = rig
game:GetService(“RunService”).RenderStepped:Connect(function()
local mousepos = mouse.Hit.Position
rig:MoveTo(mousepos)
end)