Question by
Mouroz · Dec 02, 2018 at 10:03 PM ·
c#inputinput.getkey
Input.GetKey("Horizontal")... why its not working?
"ArgumentException: Input Key named: Horizontal is unknown"
I tried using Input.GetKey("Horizontal") to check if any of the defalt horizontal keys were pressed (a,d,arrow left, arrow right)... but even doe i didnt change anything on Input.manager (its 100% defalt at all inputs) its not working... heres the whole code:
if (Input.GetKey("Horizontal"))
{
move = 1;
}
else
{
move = 0;
}
Vector2 movement = new Vector2(Input.GetAxisRaw("Horizontal") * movespeed * move, 0);
rb2d.AddForce(movement);
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612183212im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How do I save separate keycodes presses at same time and store for use later in update? 0 Answers
Using one key only, change bool to true or false depending on it's current value 2 Answers
Problems with touch input. 0 Answers
Input.GetKeyDown not reading? Am I being oblivious? 1 Answer
(Newbie's First Project) Object doesn't stop moving until long after I let go of the button 1 Answer