- Home /
Disable Player Controller/Camera when GUI is displayed?
When I first initiate my game, only the GUI is displayed and works without any issues. When I spawn my player prefab, this has a Camera/Controller/Motor attached to it and seems to break my GUI (can't click buttons anymore).
How can I address this? I assume the issue is something to do with mouse locking in the Controller/Camera script I purchased, but I am pretty confused and stuck at the moment.
Answer by LudwigVK · Apr 03, 2014 at 02:09 AM
what are you using your GUI for? a main menu? because if that's the case you could just make a different scene for the menu & then just load the game & there you should have any trouble with that. But if it some kind of in-game menu, pause menu, inventory or something like that (please be more specific), then what i'd do is: i would add to the scripts that if you're in the GUI menu the controller script is disabled, when exit is enabled again & same with the other... Also, If the GUI is suposed to be shown on screen while playing like on-screen buttons & stuff, then you have to be more specific & show us the scripts :I hope this helped you.
Thank you so much for this. The tutorial videos I have been following (https://www.youtube.com/watch?v=J4j4vlso4yc) basically just shows the Server/Client GUI right on top of the game and uses if(NetworkView.is$$anonymous$$ine) to either enable/disable the controller/camera/etc.
This seemed pretty hacky and just a way to make it work rather than how it should be done. I will try and find more information on making a different scene that can load into this the actual game. Thank you!
Your answer
Follow this Question
Related Questions
OnMouseUp() not working like meant 1 Answer
Touchscreen for unity 2 Answers
Examples of TBS/Heavily Gui-driven Games in Unity? 2 Answers
uUI - OnSelect: From Mouse/Pointer or Keyboard/Controller? 0 Answers
Using Mouse to control UI 1 Answer