local rs = game:GetService("RunService")
local player = game.Players.LocalPlayer
local character = player.Character
local mouse = player:GetMouse()
local RenderStepped = function()
local mousePos = mouse.Hit.Position
local desiredPosition = Vector3.new(
mousePos.X,
character.PrimaryPart.Position.Y,
mousePos.Z
)
character:PivotTo(CFrame.new(character.PrimaryPart.Position, desiredPosition))
end
rs.RenderStepped:Connect(RenderStepped)
i just wrote this so it might not work, if any errors pop up or you have any questions reply to this!