Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 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
1
Question by Thaldin · Jan 18, 2018 at 05:22 PM · canvasunityeditorbuttonsinterfaceinteraction

UI Buttons dont react on click

Hello everyone,

I have multiple canvas's in my scene, but everything worked fine before. Now if I click on any buttons, nothing happens. I've already checked the Eventsystem-Log and it says that I clicked the button ive clicked, but my Debug.Log entry doesn't show up in the console. If I disable my Player-Object everything works fine. I can't find out what I did wrong.

Maybe you should know that is use "Input.ResetInputAxes()" everytime the play shouldn't do any inputs. When I enable the Menu where the button is, Timescale is set to 0f but this worked before, too.

Raycast is acitve, nothing seems to block my buttons, the react if I hover over them. Maybe some has an idea what's causing the issue.

Thank you in advance if you try to help!

Note: I've checked several other questions but any answer there unfortunately couldn't help me.

EDIT: I just saw that "eligibleForClick" will set to True and stays true. On a different canvas it just stays false. Maybe you can use this information.

EDIT 2: After a few tests I've figured out that the buttons work if I disable my boundary object - a simple cube which deletes every game object OnTriggerExit (Destroy(other.gameObject)). This object is connected to my player. However I had this game object before where everything worked. If I disable it my buttons work but OnMouseDown etc won't.

Comment
Add comment · Show 4
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 Thaldin · Jan 18, 2018 at 05:25 PM 0
Share

I don't know if this is important, but I also deactivated VSync and set TargetFrameRate to 30.

avatar image houseyokeswaran Thaldin · Jan 18, 2018 at 10:32 PM 0
Share

Did you add the callback through inspector or through code?

avatar image Thaldin houseyokeswaran · Jan 19, 2018 at 02:34 PM 0
Share

I've deactivated VSync in QualitySettings inspector and call [ if (Application.targetFrameRate >= 30) Application.targetFrameRate = 30;] in LateUpdate()

Show more comments

4 Replies

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

Answer by Thaldin · Jan 22, 2018 at 04:15 PM

So I still don't know why this error occurred even if I didn't change much, I figured out that a Trigger Collider was blocking my inputs. As a solution I simply deactivate this trigger box if I open any menus. Thank you all trying to help me.

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 Neamtzu · Jan 19, 2018 at 02:56 PM

Check if you have another canvas in front of the one with the buttons that has a GraphicRaycaster component attached. If blocking mask is set to Everything it will block everything that is rendered under that canvas.

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 Thaldin · Jan 19, 2018 at 03:14 PM 0
Share

This didn't fix the problem, but I've completely ignore that. Thank you.

avatar image
0

Answer by UnitedCoders · Jan 19, 2018 at 03:47 PM

Make sure your canvas has EventSystem.

Comment
Add comment · Show 2 · 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 Thaldin · Jan 19, 2018 at 04:26 PM 0
Share

I have an EventSystem. Thank you

avatar image M929djie · Apr 21 at 11:54 PM 0
Share

The EventSystem unfortunately conflicts with the new Input System.

avatar image
0

Answer by sh_code · May 04, 2018 at 07:55 AM

old question, but for the record/completeness: hierarchy order of UI elements matters! objects lower in the hierarchy get drawn later (on top of everything above them in hierarchy), and also get the events sooner! (rendering happens back-to-front, event propagation happens front-to-back) meaning if you have a button,, and below it in hierarchy you have a panel that covers the button, even if the panel is invisible (not disabled as an object, just no image and zero alpha on background color), it will still recieve, and therefore block propagation of pointer events .

if you want to prevent this, either remove GraphicRaycaster from the element (if it is a Canvas and therefore has one), or change its blocking mask to ignore a certain layer and put the element that does the blocking on that layer to stop it from doing the blocking, OR put a CanvasGroup component on the object/UI element that does the blocking and uncheck both "Interactable" and "BlocksRaycasts"

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

83 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

Related Questions

Canvas-prefab elements are not interactable 2 Answers

No Buttons Click when Play Exported WebGL version of the Game 0 Answers

How to make cursor locked but active in Unity 2017? 1 Answer

UI Panels are not positioning themselves according to screen size 0 Answers

How to change anchor? 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