Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

GUI window is always under other GUI elements

Discussion in 'Scripting' started by April, Nov 2, 2010.

  1. April

    April

    Joined:
    Dec 14, 2009
    Posts:
    62
    Hi,
    i created GUI layout windows. and then made them draggable. However, they are always rendered under other GUI elements so they are always covered.

    It looks kinda weird because the function calling the GUI layout window is called last in the OnGUI function. Tried playing with depth values, too. but no avail.

    Can somebody help me with this? thanks
     
  2. jonyjl

    jonyjl

    Joined:
    Aug 6, 2010
    Posts:
    32
    April,

    I believe you can set a GUI element (as well as anything from what I understand) in a different layer to make it higher on the pecking order in the display list? Hope this helps I'm no pro but I do know a little about this cool app ;) Let me know if this helps!
     
  3. KyleStaves

    KyleStaves

    Joined:
    Nov 4, 2009
    Posts:
    821
    Are you using GUIText or GUITexture elements? Would you mind posting the code for your OnGUI section so we can take a look?
     
  4. BlackMantis

    BlackMantis

    Joined:
    Feb 7, 2010
    Posts:
    1,475
    Have you tried the bringWindowToFront function?