Hello there, thanks for reading, im having trouble when im trying to show a "UI created Button" on the front, without the rest of the objects making in it disappear in the back. What im trying to do is create a regular Button like New->Canvas->Panel->Button, but its always in the back even tho its always first in the hierarchy, the only way i can get away with creating buttons so far is making GUIButtons in the onGUI() function (in the end of the function). So the question is, how do i bring the UI created buttons to the front? All the things that run onGUI() render on top of the UI Buttons. Thanks again!
Answer by phxvyper
Feb 28 at 08:51 PM
In Unity, the last in the UI hierarchy is always last to render, which means that it'll appear on top of whats above it.
Move the UI Button further down the hierarchy and it should render after other objects.
Answer by ConradoLK
Feb 28 at 09:37 PM
Thanks for replying @phxvyper , but the problem is still there, there is a Camera rendering some onGUI() and thats above all, even if the Canvas is down in hierarchy
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
146 People are following this question.
how to make a button make an image show inside another button
Images as buttons with GUI skins
what replaces Toggle Using Button Style in New GUI?
How do you get a button to open a panel?
Working with the GUI 4.6 (textfields and buttons)