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)
Judging by just the title, you want:
bg.MaxTorque = Vector3.new(LookVector.X, LookVector.Y, LookVector.Z)
Make sure you change the LookVector to the humanoid.LookVector
hope this helped?