Hi everyone, I am making a scene with a first-person controller (moving a camera by using WSAD keys and rotating the camera by moving the mouse), Cube and UI Panel. My goal is the following: 1) Activate an UI Panel when I click on the Cube; 2) When the UI Panel appears, the first-person controller should be inactive so I can interact with the elements in the UI Panel; 3) Hide the UI Panel by clicking on a certain button in it (example the “X” button) and be able to walk and turn the camera in my scene again. I have already made the scripts of the ‘First-person controller’ and to ‘Cast a ray’ and ‘Detect’ an object. What I need is help for Enabling/Disabling the UI Panel. Then, when the UI Panel is shown on the screen, the first-person controller should be paused and again activated when the UI Panel is closed.
The code for detecting an object:
Thanks for help :)