Hi i wanna when the player HOLD E open a door but my code not working because if the player press E (not holding) the door will open
[SerializeField] int time;
void Update ()
{
if (Input.GetKeyDown(KeyCode.E)) StartCoroutine(Action());
if (Input.GetKeyUp(KeyCode.E)) StopCoroutine(Action());
}
IEnumerator Action ()
{
yield return new WaitForSeconds(time);
// here my code
}