test if key is down or is held down unity code example
Example 1: if get key down unity
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour
{
void Update()
{
if (Input.GetKeyDown("space"))
{
print("space key was pressed");
}
}
}
Example 2: how to check if key is held in unity
/*the other guys is right it is just*/
input.GetKey("Key") /*eg - Keycode.W/A/S/D*/