Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by InfinityGem · Sep 11, 2017 at 04:15 AM · 2duibuttonpanelhidden

Why are my UI elements hidden behind the background?

I'm having an annoying problem with building a menu screen. For starters, I'm brand new to this and this is the first project I'm trying. I'm still learning the ropes. Whenever I place a button, which is a png file I have stored in the location First_Try_At_This/Assets/Sprites folder in my project (First_Try_At_This is my project root folder), the button and panel get placed behind the background. I know because when I have my background on, which is a white screen with the title of the game I want to build on it, the button and panel are hidden. I can't see it. The screen looks like this:

alt text

Then, when I hide the background (by changing the sprite source of my background to "none"), they show up:

alt text

Can anyone tell me what I'm doing wrong? As far as I can tell I did everything right, but being a newbie, my definition of "everything" is skewed.

Thanks in advance!

screenshot-47.png (329.0 kB)
screenshot-48.png (302.7 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by Cous · Oct 20, 2018 at 05:36 PM

You need different assets on different panels. As the UI operates in only 2 dimensions. (up down, left right)your background should be a standalone panel, with just it on it. Then put your assets on different panels, In your hirecahry it should / could look this.

canvas

  • Canvas

  • background panel

  • other UI asset panel // - text // - image

Items are displayed in order of top to bottom of the hirecahry, so you need your larger elements high up, so other items display on top of them.

So on and so forth. Group UI assets that relate to each other. I. E in a fantasy game you would probably group health and mana together, but have spells in a different panel. I. E 2 health and armour in one panel and weapon icon and ammunition in another if it were a shooter genre.

Hope this helps and happy creating :)

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by primegaming365 · Oct 20, 2018 at 04:35 PM

Hi, I was having a similar problem with my game as well. I see you already have Image (script). For anyone else having this problem make sure you have that component added, because thats what fixed mine. ' Add Component' then 'UI' and finally 'Image'. Only needed to drag the sprite into the Source image and it worked for me.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image SuperLongDog · Feb 18, 2021 at 02:56 AM 0
Share

Hell yes, this is the right answer!

avatar image
0

Answer by Jam0kid · Sep 11, 2017 at 05:25 AM

Hey there, perhaps try (because of how Unity layers it's sprites) creating a few separate panels for each layer in descending render priority.

Because it looks as though you're overwriting what sprite the button has set inside it with the background and back again. Perhaps add an Image or a Panel to your hierarchy?

-edit- Make sure both are set to Sprite 2D for importing to Unity, and that the panel has the background, and the button your button.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

171 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

UI Button and character actions 1 Answer

Unity UI Panel Animation distorts buttons 1 Answer

Help With Adding Buttons To Panel 4 Answers

How to spawn an 2D sprite with a button 1 Answer

How to play two animations with one UI button? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges