- Home /
Question by
JoanneChilds · Mar 08, 2018 at 11:54 AM ·
uipanelgui.label
Is there a way to hide GUI labels when a panel is on the screen?
Each of my game objects in my game has a GUI label attached to it but when I bring up my how to play panel, you can still see the GUI labels when you hover over the game objects, even though they are behind the panel. This is my code where the GUI labels are created:
void OnGUI(){
if (ShowRollover) {
MousePos = Input.mousePosition + offset;
objRect.x = MousePos.x;
objRect.y = Mathf.Abs (MousePos.y - Camera.main.pixelHeight);
GUI.color = Color.black;
GUI.depth = 1;
GUI.Label (objRect, gameObject.name);
}
}
Is there anyway to fix this? Could someone please help me? Thanks
Comment