How to disable/enable UI on key pressed
Hello, I am trying to disable/enable a UI when a key is pressed. I have tried many ways but none have worked. What would be the best way to do this? (Please also say which version of the input system you used)
If you didn't understand whats above heres a better explanation: I want it so when I press the q key it enables a ui I have set if the ui is hidden, if the ui is showing I want the ui to hide when I press the q key
Thank you have a great day :)
FAQ :
What are the guidelines for writing good questions?
We want Unity Answers to become a comprehensive database of questions and answers related to Unity. When you ask your questions, it can be helpful to keep a few things in mind:
Break multi-part problems into simpler questions. Instead of posting a question: "How can I make a gui toggle to change the skybox?", post two simpler questions instead: "How can I make a gui toggle?" and "How can I change the skybox?" This way the questions will also be relevant to people who want to make a toggle for something else, or who want to change the skybox based on something else.
Some reasons for getting a post rejected:
You haven't provided enough context: we need more information about your problem, relevant code snippets and what you have tried already.
Your question isn't specific enough: asking for a script, asking multiple questions in one post or asking a question that could be either subjective or require extensive discussion
There exists duplicate questions with answers if you were to do a search, either on Answers or on the Forum or on Unity's tutorials