- Home /
Stop working of behind layers in UI
I am using Unity UI for create menus for my game. I want to dialog box above my main menu screen. So that I want to stop working of my main menu buttons. Only dialog box controls remain in working condition.
How to do that?
Just place a gameobject and attach a Image and set it transparent and full stretch your screen behind you dialog UI and front of other UI elements that you don't want to interact with them .
Whether I need to add any colliders? As we do in normal in our game to stop detection of far objects.
Answer by Firedan1176 · Sep 28, 2015 at 12:03 AM
You can place a UI Panel in between the main menu buttons and the dialog box. Once you click the button to show the dialog box, you can enable the panel so that it covers the main menu. Because the panel has an image script, it blocks raycasting to the buttons on the menu (as long as the panel covers the main menu buttons). Then, you can disable the panel again when you close the dialog box.
You can enable/disable the panel by using the OnClick functions of the button scripts that are already on the button.
Your answer
Follow this Question
Related Questions
How to display 3D object on top of UI World Space Canvas in VR 0 Answers
Unity 4.6 Mask Component on Android doesn't work properly. 2 Answers
How can you hide Canvas objects using Camera Culling Mask? 1 Answer
Display a world-space canvas to overlay all the meshes but not the other UI objects 0 Answers
Dual Stick Touch Shooter 0 Answers