how to get a key input in unity code example
Example: unity key detection
if (Input.GetKeyDown(KeyCode.Space))
{
print("space key was pressed");
}
if (Input.GetKeyDown(KeyCode.Space))
{
print("space key was pressed");
}