I’ve been using Unity for a week now, and I’m having problems right from the start.
Problem
When running Game Playtest, the left and forward arrow keys are held down.
Background
I followed Unity Learn and proceeded with Roll-a-ball.
When using Input.GetAxis command to get keyboard input, the left arrow key and up arrow key were input even though nothing was pressed.
Using Debug.Log, the input was indeed from the keyboard (-1,0,1).
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
The same phenomenon occurred in the game of the .exe file.
Doubting my code, I downloaded and ran the Micorgame sample (Karting Microgame, 2D Platformer Microgame).
The left arrow key and up arrow key were inputted as well.(The body was leaning to the left even though the keyboard was not pressed, Player keeps running to the left)
Disconnected all input devices such as keyboard and gamepad: Press and hold occurred.
Run Playtest: Press and hold occurs → Stop Playtest and run Playtest again: Solution → Deactivate Unity window → Activate it → Run Playtest: Press and hold occurs again
but you could test if you remove the 2nd Horizontal and Vertical inputs from the input manager (its for joysticks), and that fixed it for those laptops…
However, when I played the game in Unity Play, I had the same problem (this time, the right and down arrows were still pressed).
If I make own games, this way seems to solve the problem, but there’s a root cause of the problem.
I’ll make sure to check the forum.
Hi, anyone else who comes across this should know that I fixed my version of this problem by unplugging other controllers/joysticks, like steering wheels or clutches because Unity recognizes them as controllers.
Just if still someone has issue with Left Arrow Key Stuk
I faced the same problem using Unity 2022 but the issue was not anything from Unity itself actually the problem was from the Nvidia driver. I use a laptop with Nvidia Quatro RTX A2000 . when I used the driver from the Nvidia site the left arrow key stuck but then when I updated the Nvidia driver from the Dell official site for my laptop model and issue resolved.