First, remove the Y component of your positions, e.g.:
local bodyPos = body.Position * Vector3.new(1,0,1)
ore equivalently:
local bodyPos = Vector3.new(body.Position.X, 0, body.Position.Z)
Do the same with mouse.Hit.Position. This will ensure that CFrame.new(p1,p2) gets you a CFrame that is “upright”, with just Yaw rotation, not trying to tilt your character.
Then, ignore the mouse hit position if it’s too close to the character. e.g. if (mouseHitPos - bodyPos).Magnitude < 1
or something like that. If the mouse hit position is too close to your character, the direction will become numerically unstable (the “when you’re at the South Pole, every direction is North” singularity problem)
Last, ignore the mouse hit position if the hit part is actually part of your character, otherwise the character’s going to move while the mouse is still hovering over it, and you’ll get rapid jitter from the hit position changing when the character moves. Alternately, you can ditch mouse.Hit altogether and manually raycast using a ray from Camera:ViewportPointToRay() and exclude the character from the raycast params.
Also, this:
body.CFrame = CFrame.new(look.Position) * CFrame.Angles(0,y,z)
should now be:
body.CFrame = look + body.CFrame.Position
If you just use XZ-plane vectors, you don’t need to go to Euler angles and back (which has its own problems)