Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

‘Raycast Target’ enabled by default on Image/Text

Discussion in 'UGUI & TextMesh Pro' started by ortin, Aug 18, 2016.

  1. ortin

    ortin

    Joined:
    Jan 13, 2013
    Posts:
    221
    So I found this link accidentally
    https://unity3d.com/cn/learn/tutorials/topics/best-practices/fill-rate-canvases-and-input
    with this "cool" part:
    So simple question to Unity devs: why on earth it's enabled by default on Image/Text if it contradicts your own "best practices"?!
     
    wlwl2, eskivor, RoyHU and 2 others like this.
  2. wlwl2

    wlwl2

    Joined:
    Jun 17, 2018
    Posts:
    29
    There is an additional problem if it is on/checked by default which is that it interferes with OnPointerEnterDelegate() (UnityEngine.EventSystems). Basically, if your mouse is hovered over buttons with any images overlapping them, it causes a problem when you have to hover more than expected to select the button. It took me a long time to figure out this bug existed (when it was right in front of me in so many buttons), and a long time to debug it, as UI is hard to debug compared to code.

    I think that it is a good thing to enable by default only for interactables. Also, there is still no tooltip for it (and "Maskable") now (2019.4).

    I'm also not sure if a new UI system will fix this, I think they are working on upgrading Unity UI again.
     
    Last edited: Aug 16, 2020