I’m trying to get my console UI to open when you press enter or return. But it just wont work. I think my code is correct but I’m not sure.
My code:
public static bool Console = false;
public GameObject consoleUI;
void Update()
{
if (Input.GetKeyDown(KeyCode.Return))
{
if (Console)
{
Open();
}
else
{
Close();
}
}
}
public void Open()
{
consoleUI.SetActive(true);
}
public void Close()
{
consoleUI.SetActive(false);
}