Hello, I wrote the code for my 2D project that should open the door and disable the black screen in the next room once button F is pressed.
{
Button.enabled = false;
BlackScreen.enabled = true;
}
private void OnTriggerEnter2D(Collider2D collider2D)
{
if (collider2D.gameObject.tag == "MAIN_Hero")
{
Button.enabled = true;
if (Input.GetKeyDown(KeyCode.F))
{
BlackScreen.enabled = false;
}
}
}
The code doesn’t show any mistakes, however the Key F isn’t working. I checked if it was a problem with UI but everything was working perfectly. Am I missing something?
`