Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Mouseover & click hits off-center of button :(

Discussion in 'UGUI & TextMesh Pro' started by Palimon, Feb 18, 2016.

  1. Palimon

    Palimon

    Joined:
    Apr 18, 2013
    Posts:
    225
    Hey all, I have a few buttons that are not behaving themselves. Everything about them works as-expected, except that the mouseover and clicks are off-center. You can see in the image that the crosshairs (which I've checked are centered :p, and have been for ages) are not over the first button (R&R) yet it is highlighted. The mouse is at the very bottom - any further and it will fall off the first button. The hit-boxes are identical in size to the buttons, just off-center on the Y-axis. Any ideas what the heck is going on? I've looked at the various rects, and they all look good to me. This is a worldspace canvas, so there's that.

    Image 1.png
     
    Last edited: Feb 18, 2016
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,850
    Do you have any other rects that could be blocking the mouse so it does not trigger the button?
    Try selecting the event system and watching the preview window which will tell you the name of what the mouse is over.
     
  3. Palimon

    Palimon

    Joined:
    Apr 18, 2013
    Posts:
    225
    Hmm, I don't see a preview window, or any options in Window or searching online for a way to bring one up. But I did inspect all the surrounding Rects, and they all look placed properly.
     
  4. Peez-Machine

    Peez-Machine

    Joined:
    Jul 30, 2013
    Posts:
    27
    GraphicRaycaster is borked and uses the wrong raycast method, which I've seen create a lot of problems with regards to blocking and positioning of a cursor when using world-space canvases. I've followed up on an existing ticket (Case 725973) which fixed a similar issue with Physics2DRaycaster, but I haven't gotten a solid "we're on it" yet.