Why won't this Body Gyro script work?
I wanted to make it so when you press 'Shift' it makes your Character
face the Position
of the Mouse
... However, it won't do that and I have no clue as to why it won't work correctly... This script is a LocalScript
inside of StarterGui
....
01 | ocal player = game.Players.LocalPlayer |
02 | local mouse = player:GetMouse() |
03 | local bg = Instance.new( "BodyGyro" ) |
04 | bg.maxTorque = Vector 3. new( 400000000 , 400000000 , 400000000 ) |
07 | mouse.KeyDown:connect( function (key) |
08 | if string.byte(key) = = 48 then |
09 | local torso = player.Character.Torso |
12 | while debounce = = true do |
13 | bg.CFrame = CFrame.new(mouse.hit.p) |
19 | mouse.KeyUp:connect( function () |
Thank you for reading the whole question and I hope someone can help me out!