I am making a soccer game and I am trying to make it so when the player presses “G” their body will be facing the ball until G is released.
if inputObject.KeyCode == Guard then
ball = court:FindFirstChild("Ball")
local rootPart = player.Character:FindFirstChild("UpperTorso")
while true do
rootPart.CFrame = CFrame.lookAt(rootPart.Position, ball.Position)
This is what I have so far and it technically works but the issue is every time the while loop runs it changes the direction the player is facing which makes it look very glitchy. Wondering if there was a way to make this a lot smoother.