Trying to use UIS to detect a key down but just getting "Keycode is not a valid member of Input"?
Hi, I'm trying to use UserInputService to detect when the left shift key is pressed and released. I wrote this following some tutorials I found but whenever I try and use it I just get "Keycode is not a valid member of ImputObject." I don't know what I'm doing wrong and when I look for other tutorials it's just the same as what I'm already doing. This is inside a LocalScript within StarterPlayerScripts. I tried it in StarterCharacterScripts as well but it didn't make a difference.
01 | local UIS = game:GetService( "UserInputService" ) |
03 | UIS.InputBegan:Connect( function (input) |
04 | if input.Keycode = = Enum.KeyCode.LeftShift then |
05 | print ( "Shift pressed" ) |
09 | UIS.InputEnded:Connect( function (input) |
10 | if input.Keycode = = Enum.KeyCode.LeftShift then |
11 | print ( "Shift released" ) |