- Home /
error CS0117: `Input' does not contain a definition for `GetKeyDown'
Heya. My script was working fine until just out of the blue it decided that Input didn't contain a definition for GetKeyDown, it happened across all my scripts that used Input.GetKeyDown. I also have the same problem with Input.GetKeyUp. Here is one of the scripts: Animator animator;
void Start () {
animator = transform.GetComponent <Animator> ();
}
void Update () {
if(Input.GetKeyDown(KeyCode.RightArrow)){
StopCoroutine ("Press");
StartCoroutine ("Press");
}
if (Input.GetKeyUp(KeyCode.RightArrow)) {
animator.SetBool("ArrDown", false);
}
}
void Press () {
animator.SetBool("ArrDown", true);
}
}
If anyone could help, that would be awesome :) Thanks!
Answer by tanoshimi · Oct 26, 2015 at 07:20 PM
Did you name your script Input.cs, perchance? Then you've overridden the default Input class. Call it something else.
Thanks! It turns out I did have a file named Input, except after reading other similar questions I tried rena$$anonymous$$g the file and it still didn't want to work (Probably should have mentioned that in my first post :P). Took a bit more messing around and found out that to make it work I had to delete the file from my hard drive, that was all :) Again, thanks heaps!