I've been trying to set the MaxTorque of the BodyGyro to a humanoid LookVector for a while now but i can't seen to figure it out. This my whole script, thank you for helping me.
local UIS = game:GetService("UserInputService")
Player = game.Players.LocalPlayer
Mouse = Player:GetMouse()
char = Player.Character
hum = char.Humanoid
root = char.HumanoidRootPart
local holdingUKey = false
UIS.InputBegan:Connect(function(inputObject)
if(inputObject.KeyCode==Enum.KeyCode.U)then
holdingUKey = true
while holdingUKey do
local bp = Instance.new("BodyPosition")
bp.Parent = char.UpperTorso
bp.Position = char.UpperTorso.Position
bp.P = 10000
bp.D = 1250
bp.MaxForce = Vector3.new(4000,4000,4000)
local bg = Instance.new("BodyGyro")
bg.Parent = UpperTorso
bg.D = 500
bg.MaxTorque = Vector3.new(char.UpperTorso.Position,Mouse.hit.p)
bg.P = 9999999
bg.CFrame = CFrame.new(char.UpperTorso.Position, Mouse.Hit.p)
char.Humanoid.AutoRotate = false
wait()
bg:Destroy()
bp:Destroy()
char.Humanoid.AutoRotate = true
end
end
end)
UIS.InputEnded:Connect(function(inputObject)
if(inputObject.KeyCode==Enum.KeyCode.U)then
holdingUKey = false
end
end)

5 comments
"They are redundant and its only use is in math." - this is not true. Please stop perpetuating this myth.
I still don't understand how i can fix my script. To work the proper way.
LookVector isn’t a property of humanoids. Second, and I could definitely be wrong, but I don’t think that is actually detecting that you’re holding the key down. It sees that input BEGAN, but not CONTINUED.
Actually @Karasu_H, the variable 'holdingUKey' is set to true until the InputEnded event was fired. So it stays true until he lets go of the key he was holding.
It sounds like you want to set the CFrame of the BodyGyro and not the MaxTorque, which represents magnitude and not direction