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 KeySama · Sep 04, 2015 at 02:51 PM · 2duibutton

Unity UI button does not detect click

So I'm trying out Unity's UI buttons, and I can't seem to get them to work when I click. I looked at the UI button video that the Unity guys made, but that didn't help me solve my problem. Whenever I click on the button I have, nothing happens. No color change or anything. I tried deleting-readding the button. But that didn't help. Still couldn't get the clicking to work.

I checked on some places online, and all they said was to check to make sure I have an EventSystem, a graphic raycaster, and make sure that the button is a child of a canvas. I got all three of these. So what else should I check/try to get my button working?

By the way, this is all in Unity 5's 2D mode, if that matters.

alt textalt text

unityproblem1.jpg (87.3 kB)
unityproblem2.jpg (81.3 kB)
Comment
Add comment · Show 8
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 KeySama · Sep 04, 2015 at 09:25 PM 0
Share

So I also tried changing around the position/anchors of the button... didn't work. I even tried deleting everything except for the camera, canvas, button, and event system... didn't work either.

avatar image Colrl · Sep 04, 2015 at 10:50 PM 0
Share

What do you have on the OnClick() function for the button?

avatar image KeySama · Sep 04, 2015 at 10:56 PM 0
Share

@Colbanus

Right now, for the OnClick() function, I just put in a function that prints out a message in the console. But even if I didn't have the OnClick() function, the button should at least change color when I click it, right?

avatar image Colrl · Sep 04, 2015 at 10:58 PM 0
Share

@$$anonymous$$eySama yea i see, what do you have on the EventSystem?

avatar image kbumpious · Sep 05, 2015 at 12:56 AM 1
Share

I am not sure. I have always used Canvas -> Render $$anonymous$$ode -> Screen Space Overlay. I checked out screen space camera and it looks like it is the same idea... $$anonymous$$y only guess is that it is not registering clicks because you have a transparent object of some sort on top of your button. Possibly your item display area? Check all of your layering.

$$anonymous$$aybe just try closing and reopening Unity (I'm sure you already have).

Show more comments

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by KeySama · Sep 05, 2015 at 07:43 AM

Figured it out. Turns out, I needed to add in an input in my InputManager for mouse clicks. Whoops.

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
0

Answer by erfan · Sep 05, 2015 at 07:54 AM

make sure that there is not anything in front of your button. perhaps some other UI element have extra boundaries that blocks raycast to reach to 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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

How to detect button presses and change child object text in the button's Parent Object script 0 Answers

Help check click out of UI 2 Answers

How to make UI buttons so my player can move along certain lines 0 Answers

How to make a button animation in menu 1 Answer

Enable UI Button from Prefab 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