Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by 8kedition · Feb 25, 2016 at 10:19 PM · uibutton

UI Button is unclickable based on position in Hierarchy

Im experiencing an issue which seems very strange to me although there could possibly be a very logical reasoning behind it. I havent developed in any of the recent Unitys with my last being either 4.5 or somewhere before that when they didnt have the new UI component (Not that I remember).

Anyways, my issue lies in having a UI element with a button script on it. To put it simply, as you can see in the image, having my BookPower(1) located above the disabled BookPageFood causes the button to be unclickable in the game view, whereas putting it directly below the BookPageFood allows the button to be clickable.

There doesn't appear to be anything blocking the way, and whats more peculiar is that if I were to place BookPower(1) under BookPageFood (Making it clickable), and I deleted BookPageFood, the button once again becomes unclickable.

Hopefully that didnt come out too confusing.

Is there something Im not understanding about the new UI system that should be blatantly obvious to me?

unity.jpg (29.5 kB)
Comment
Add comment · Show 2
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 Jack-Does · Jun 06, 2016 at 07:52 PM 0
Share

did you ever figure out how to fix this? i know i can move the button in the hierarchy and it will work but im going to have a lot of buttons and want to keep thing organized.

avatar image b45h05h4 · Jun 27, 2017 at 11:16 AM 0
Share

@8kedition have u ever solved this ?? :)

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Mmmpies · Jun 07, 2016 at 09:34 AM

Put a CanvasGroup on your UI elements and uncheck the BlocksRaycast on any element that isn't supposed to be at the top.

And there's irony there as well because for the new(ish) UI top means bottom. In that image the BookPageFood panel has moved below the button you want to click, this means it's on top of the button on your screen.

Now you can disable clicks being blocked with a canvas group but I'm also thinking your layout might be the issue. Should those buttons be at the top of the page and not blocked at all?

The UI is mighty powerful and a vast improvement but it does take some getting used to, the best advice is to put the Anchors to the corner of each element. This locks the scale of that item so it scales for different resolutions/ aspect ratios.

Like this: alt text

If the Anchors of the BookPageFood panel are at the corners then it shouldn't expand out over the buttons but it really depends on your layout.


anchors.png (7.4 kB)
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

6 People are following this question.

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

Related Questions

How to play different animations with different UI button presses. 1 Answer

How to switch cameras with ui buttons? 0 Answers

find an especific multitouch wich is on a image in the canvas 0 Answers

How to find an UI button by name? 2 Answers

Text on UI Button Not Updating 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