Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
3
Question by MDarkwing · Feb 10, 2015 at 10:51 AM · uibuttonimage

How to click on button that is behind transparent image in New UI?

I'm having trouble finding out how to click on a button that is behind a image that I use as a mask of some sort. Can i make that image unclickable? It seems reasonable that images are unclickable objects, but when the image is in front of the button then I cant get buttons to work. After I move the image in hierarchy or disable game object the click works.

Is there any way to handle what is clickable and not in the new UI? (I've tried ignore raycast layer with no luck)

Thank you in advance.

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

2 Replies

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

Answer by Mmmpies · Feb 10, 2015 at 10:59 AM

You can put a CanvasGroup on the panel and untick interactable and blocksRaycast or move the button down the hierarchy when you want it in front of the panel. Not got access to unity so from memory its setlastsibling.

Comment
Add comment · Show 5 · 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 MDarkwing · Feb 10, 2015 at 11:10 AM 0
Share

panel object doesn't have interactable checkbox dude. And i need mask in front of the buttons for visual effect, as I've stated above I know that i can move elements down and up both manually and via script. Im looking into the Canvas.GraphicRaycasterScript now to see if i can do sonething with it

avatar image Mmmpies · Feb 10, 2015 at 11:12 AM 0
Share

Highlight the panel.

Click Add Component -> CanvasGroup

The tick boxes are on there.

avatar image MDarkwing · Feb 10, 2015 at 11:16 AM 0
Share

Thanks you it worked but kinda retarded way to do it, complicates stuff a lot. Thanks anyway man. (Y)

avatar image Mmmpies · Feb 10, 2015 at 11:24 AM 0
Share

Hey I didn't create the UI, but I can see how having a separate component that can make any UI element or group of elements visible/interactable/blockRaycast is neater than adding all of those to each UI component as default.

avatar image MDarkwing · Feb 10, 2015 at 11:27 AM 0
Share

Yeah no bad things meant to you man, I'm just annoyed untill I get more comfort with the new UI. You helped me thus you rock :D

avatar image
11

Answer by Carlotes247 · Dec 21, 2015 at 02:58 AM

Hello, just to update it with Unity 5.3, you can deselect a boolean field in the Image component, called "Raycast Target". It ignores the raycast of the event system and there is no need of adding another component :)

alt text


captura-unity.jpg (21.2 kB)
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 fr0stsp1k3 · Sep 03, 2018 at 07:22 PM 0
Share

This is ABSOLUTELY the best way to do it, this should be the answer! Way many kudos, been making panels, and it didnt work properly.

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

23 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

Related Questions

Image in Button is cut (New UI) 2 Answers

Detect Input type by checking if ANY key on keyboardd/joypad is pressed 1 Answer

Best Button for UnityGame 2D 1 Answer

Prevent Button from tinting child Images 1 Answer

Scrollable Achievement Tabs? 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