Search Unity

IPointerEnter working unexpectedly on GridLayoutGroup element

Discussion in 'UGUI & TextMesh Pro' started by MartinIsla, Feb 4, 2019.

  1. MartinIsla

    MartinIsla

    Joined:
    Sep 18, 2013
    Posts:
    104
    Good evening everyone!

    I'm working on a small menu that's ordered in a GridLayoutGroup.

    upload_2019-2-4_19-48-54.png

    The icon is just a visual, a UI image (not marked as raycast target) that's a child of the Slot.
    The slot also contains an image (that is marked as a raycast target) and the script that implements the IPointerEnterHandler interface.
    OnPointerEnter, I show the description on top ("Build house" etc). This works correctly.

    The problem is OnPointerEnter is only works on the lower part of the slot.

    wrong.gif

    As you can see, it only gets detected when the pointer is on the 25% or lower portion of the image.

    Do you guys have any idea what could be happening?

    EDIT: Oh, I think it's worth exlaining that after clearing the text, the panel stays there for 0.5f seconds before hiding in case you hover over another icon.
     
  2. MartinIsla

    MartinIsla

    Joined:
    Sep 18, 2013
    Posts:
    104
    Update:

    I'm stupid. The TextMesh Pro of the description was blocking the higher portion of the slot.

    Be happy.
     
    iancox890 likes this.