I have a script that makes the player point at the mouse with CFrame.
local thread = coroutine.wrap(function()
while true do
wait()
player.Character.HumanoidRootPart.CFrame = CFrame.new(player.Character.HumanoidRootPart.CFrame.Position, Vector3.new(mouse.Hit.X, player.Character.HumanoidRootPart.CFrame.Position.Y, mouse.Hit.Z))
end
end)
thread()
This is just an example, but when I tried it what happened is that. The user keeps glitching when they move, is there any alternatives to make the player point at the mouse while they can move without getting glitched? Like Animation or etc. It's just that I don't know how. Thanks if you can help me with this!

2 comments
Try replacing CFrame with Vector3, because mouse.Hit.p returns a Vector3 value
I use CFrame to rotate the player, if I use Vector3 that will transport me to the mouse.