- Home /
C# Input Key Named: Alpha1 is Unknown
I've been trying to create a script using the number keys. For some reason I'm getting this error Input Key named: Alpha1 is unknown and it points to the following line of code below. But I don't understand why. Any idea what's wrong?
if(Input.GetKeyDown("Alpha1")){}
Comment
Best Answer
Answer by Eric5h5 · Nov 14, 2013 at 04:48 AM
Use KeyCode enums, not strings. GetKeyDown(KeyCode.Alpha1)
Your answer
Follow this Question
Related Questions
FPS keep a loadout 0 Answers
C# Number Key For Loop 1 Answer
C# Character Controller Collision If Statement 2 Answers
unity c# RPC 0 Answers
adding animation dynamically by script 0 Answers