- Home /
button drawn last not triggered
Hi folks,
I have a tricky situation where I want a button to be over another. Like a smaller button drawn on top of a bigger button.
I have the following code in my OnGUI function, the small button is never pressed.
if (GUI.Button (Rect (0,360,100,100), "BIG")) {
Debug.Log("BIG Button");
}
if (GUI.Button (Rect (0,360,50,50), "small")) {
Debug.Log("Small Button");
}
I've been playing with GUI.depth, nothing does to it.
Comment
If you put the small button behind the big one(calling it first) it works well, interesting...
Your answer
![](https://koobas.hobune.stream/wayback/20220613081147im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Overlapping GUI buttons 1 Answer
GUI Button overlap problem 1 Answer
GUI.Depth text input/button issues 1 Answer
GUI.Label appearing behind GUI.Button 1 Answer
Overlapping GUITexture UI Buttons 2 Answers