GetKeyUp not working with KeyCode.Tab,Input.GetKeyUp not working with KeyCode.Tab
Hi,
I have a problem with GetKeyUp with Tab key. I have searched a lot about the problem and everyone elses problem seems to be because they had it in FixedUpdate, I have not however. I have tried the following:
void Update()
{
if (Input.GetKeyDown(KeyCode.A)) scorecardObject.SetActive(true);
if (Input.GetKeyUp(KeyCode.A)) scorecardObject.SetActive(false);
if (Input.GetKeyDown(KeyCode.Tab)) scorecardObject.SetActive(true);
if (Input.GetKeyUp(KeyCode.Tab)) scorecardObject.SetActive(false);
}
Pressing A-key will show my scorecard and releasing will hide it, which works perfectly. Pressing tab will show it but releasing doesn't make it go away. Another strange thing is that if I first press tab and release it scorecard stays up like previous problem, but now it will not dissapear when I press and release A-key.
Any ideas on what causes this behaviour? ,Hi,
I have a problem with GetKeyUp with Tab key. I have searched a lot about the problem and everyone elses problem seems to be because they had it in FixedUpdate, I have not however. I have tried the following:
void Update()
{
if (Input.GetKeyDown(KeyCode.A)) scorecardObject.SetActive(true);
if (Input.GetKeyUp(KeyCode.A)) scorecardObject.SetActive(false);
if (Input.GetKeyDown(KeyCode.Tab)) scorecardObject.SetActive(true);
if (Input.GetKeyUp(KeyCode.Tab)) scorecardObject.SetActive(false);
}
Pressing A-key will show my scorecard and releasing will hide it, which works perfectly. Pressing tab will show it but releasing doesn't make it go away. Another strange thing is that if I first press tab and release it scorecard stays up like previous problem, but now it will not dissapear when I press and release A-key.
Any ideas on what causes this behaviour?