Unity Ugui Button cannot click on a problem example

Source: Internet
Author: User

Theoretically, as long as a button itself this layer or child node has a control to check the Raycasttarget, and the button is interactable. and is not blocked by other clickable controls, this button can be clicked

In the adjustment of an interface to find a strange problem, there is a button can not be clicked, EventSystem can not detect. A button next to it is OK

In contrast, the difference between the two is that:

Clickable x-axis rotation-180

Non-clickable no rotation

will not be clickable rotation-180, found can click on the

Troubleshoot the parent node and find that the parent node has an image rotated 180 for performance.

Now that the problem is determined by rotation, Google has found a post:

https://forum.unity.com/threads/button-with-rotation-y-180-can-not-click.293482/

Confirm that Ugui cannot accept the click of the Reverse button.

In discussions with colleagues, colleagues remind you whether a switch accepts a reverse click, which is the Graphic raycaster Ignore reversed graphics option

Of course this option is checked by default and does not accept reverse clicks for performance considerations when clicked.

So in this case, you have to rely on the interface to watch the rotation. It is not recommended to turn off this switch

After the interview, even if the hook off, if I rotated 90 degrees naturally also can not accept the click

Looked under the relevant source code, is according to this gameobject vector3.forward to calculate. So be careful.

Of course you can consider writing a script that detects whether this forward is screen-oriented and corrects

Generally speaking, there is no clickable object that is back-to-screen or 90-degree rotation.

Unity Ugui Button cannot click on a problem example

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.