Script that makes player face mouse causes Player to slowly inch towards direction

I am making a script that makes the player face the direction their mouse is pointing to. However, when the player isn’t moving (the person isn’t pressing WASD), it will slowly inch towards whichever way the mouse is pointing. My script is as below:

local Player = game.Players.LocalPlayer
local character = Player.Character or Player.CharacterAdded:Wait()
local mouse = game.Players.LocalPlayer:GetMouse()
wait(5)
while character:FindFirstChild("Humanoid").Health > 0 do
	wait()
	character.LowerTorso.CFrame = CFrame.new(character.LowerTorso.Position, Vector3.new(mouse.Hit.p.X, character.LowerTorso.Position.Y, mouse.Hit.p.Z))
end

Trying this exact code myself, I didn’t have this issue. Do you use a custom character of some sort?

Also would like to point out how inefficient this code is, might cause lag down the line.

1 Like

I tried it on a completely new baseplate, it doesn’t work for me. I’ll send a video real quick

1 Like

Thats odd, where is the script placed?

1 Like

It is placed in “StarterPlayerScripts”

Weirdly, changing LowerTorso to UpperTorso actually fixed the script.