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 /
avatar image
0
Question by callen · Feb 22, 2016 at 09:39 PM · uiinputbutton

What order do UI elements capture input?

My setup is, I have two Canvases which act as popup screens. They are set with Screen Space - Camera, and both are assigned to the same main camera. The front canvas has plane distance of 1 and the back canvas' plane distance is 9.

Each canvas has a fullscreen near-invisible "background-button" to call SetActive(false) and hide their canvas when you tap outside of the popup's content.

In my hierarchy these two canvases are siblings, with BackCanvas appearing above FrontCanvas. Everything renders as it should, front popup screen with its bg-button are overlaid on top of the back popup and its bg-button.

However when interacting with the popups, the back canvas is getting "input priority" over the front one. For example, when I tap outside the content of both popups, the back popup's bg-button is triggered and that screen closes, while the front canvas remains. A second tap will close the front one, since the back one was hidden.

None of this is using any scripts I've written, it's all just UI Buttons and their OnClick events hooked up to GameObject.SetActive calls.

I need to know what is causing this? Can I fix it? Thanks!

Comment
Add comment · Show 1
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 callen · Feb 23, 2016 at 08:09 PM 0
Share

No one can point me in the right direction? The last time I asked about UUI events I only got one joking comment as a response. Is there really no information out there about event propagation / execution order? It seems like a core part of any UI framework so I'm baffled at how little help I'm getting here or from the docs.

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by callen · Feb 23, 2016 at 09:29 PM

I guess I figured it out, though after reading this thread who knows if it'll work going forward, since it was supposed to work correctly already using plane distance. However, the plane distance on my canvases are having no effect on the input capture order.

My solution was to set canvas' "Order In Layer" (I believe layerOrder in code) higher on the front-most canvas. Then it all seems to work as intended.

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

51 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

Related Questions

OVRInput keys are not working 0 Answers

Refactor code from getting input from keyboard to get input from UI Buttons 1 Answer

UI button and Touch Input conflict 1 Answer

Detect which local player clicked a button 0 Answers

Button.onClick.AddListener 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