csharp unity get key
Code Example - csharp unity get key
[SerializeField] KeyCode your_key; //select a key in the inspector
void Update()
{
if (Input.GetKey(your_key))
{
print("your selected key was pressed");
}
}