#How do I read input for keyboard press and releases?

1 messages · Page 1 of 1 (latest)

tribal mesa
#

I'm trying to make a simple script where if I press and release a button it prints NumberValue. Where if I press Q it prints 1, when I release Q it prints 0, and it prints 2 when I press E but this doesn't seem to work, the console error message is in the second image

shrewd matrix
#

Did you get the userunput service correctly?

#

Underlined for the variable makes me thinking something is spelled wrong or no correct capitalization somewhere

#

Code looks fine besides that

#

Also number value would be NumberValue = 1 not ==

#

= is assigning, == is comparison

grim frost
#

You cannot assign another if statement with "else". Write elseif.

#

To check for presses and releases, you have to check the input actions of inputObject.

sullen questBOT
#

studio** You are now Level 8! **studio

tribal mesa
#

ahhh ur right it solved itself

#

its working perfectly now thanks for the help 🙏

tribal mesa
#

changed the Q and E to A and D and made a cool camera system out of this though its kinda bugged when i press both A and D at the same time lol