I'm trying to turn the character left instantly when pressed A and turned right instantly when pressed D. Everything except the turning left or right works. It does print out debug when keys pressed.
local plr = game:GetService("Players").LocalPlayer local char = plr.Character or plr.CharacterAdded:Wait() local rootpart = char:WaitForChild('HumanoidRootPart') local humanoid = game:GetService("Players").LocalPlayer.Character.Humanoid humanoid.AutoRotate = false BodyGyro = Instance.new('BodyGyro') BodyGyro.Name = 'Turning' BodyGyro.Parent = rootpart BodyGyro.P = 10000 BodyGyro.D = 1000 game:GetService("UserInputService").InputBegan:connect(function(input) if input.KeyCode == Enum.KeyCode.D then print "debug" BodyGyro.CFrame = CFrame.new(0,-90,0) end end) game:GetService("UserInputService").InputBegan:connect(function(input) if input.KeyCode == Enum.KeyCode.A then print "debug" BodyGyro.CFrame = CFrame.new(0,90,0) end end)
If you want it to be instant there is no need to use a body gyro, you can change it instantly using CFrame or (I would not suggest this) Orientation.
You can find out more about CFrame here: