unity 3d press a key c# code example
Example 1: unity getkey keycode
Input.GetKey(KeyCode.Space))
Example 2: press key run code unity c#
if(Input.GetKey(KeyCode.space))
{
print("Space key was pressed")
}
Input.GetKey(KeyCode.Space))
if(Input.GetKey(KeyCode.space))
{
print("Space key was pressed")
}