I have researched and searched at the various keyboard input issue threads but none of the solutions seem to be working for me.
I made a blank project, and created a blank game object in the scene. I attached the below script:
public class Foo : MonoBehaviour
{
// Use this for initialization
void Start()
{
}
// Update is called once per frame
void Update()
{
Debug.Log("Foo" + Input.GetAxis("Horizontal") + Input.GetMouseButtonDown(0) + Input.GetKeyDown(KeyCode.A));
}
}
However, the only thing that seems to register input is the mouse down. I have checked the project settings->input like many other threads mention, but there is nothing wrong with those.
ProjectSettings->Input
I have tried using the StandardAssets controler that came with unity and I still have issues with the keyboard registering input.
Does anyone know what is wrong with this?!
@Neo Murakami .Try setting the Edit → Project Settings → Editor → Joystick Source to Local.
Are you trying to make “Foo” show up in the console on ANY keyboard key entered? you can use if (Input.anyKey)
I’m not an expert but the code you wrote looks like you’re only going to get FOO to show if you’re doing all three of those things at once?
So i had this same problem… unity refused to identify key presses from my keyboard, or identify my android back button … I did testing in an update function that was
if (Input.anyKey)
Debug.Log("A key was pressed");
With this, unity would respond to mouse clicks in my scene, but not the keyboard, and still no android back button … one answer that previously worked was related to the event manager needing to be forced active at all times, but not so lucky for an easy answer this time… So i copied my project data into a new unity project and it worked as intended… go figure…
So after 3 days of looking for answers and doing what people think was the problems solution was across nearly 100 posts for this relative question, i finally resolved this problem by deleting the library folder for my project and allowing unity to recompile the whole thing. After doing this, everything worked as intended. It is worth noting that in my case, it was not enough to re import the project, if you have reached your wits end and exhausted all other options you NEED to delete the library folder. This will not harm your project in any way.