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. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

Question Having a hard time with IPointerHandler

Discussion in 'UGUI & TextMesh Pro' started by Naotagrey, Oct 18, 2022.

  1. Naotagrey

    Naotagrey

    Joined:
    Apr 17, 2016
    Posts:
    37
    Hey!
    For a while I've been working on my project, and I've recently started getting issues that are new, but very annoying when using IPointerHandler (OnPointerEnter and OnPointerExit), IDragHandler, etc..
    I use those for a variety of needs like tooltips and opening panels when UI elements are hovered.

    A while ago I had to move from rendering my main UI canvas as Screen-Space Overlay to Screen-Space Camera Mode, and I've started running into a lot of issues:
    -OnPointerEnter not being called on most of the Graphic's surface
    -OnpointerExit being called next frame directly even though nothing appeared in front of the graphic
    -OnDrag not being called under similar circonstances

    upload_2022-10-18_11-10-27.png

    upload_2022-10-18_11-12-4.png


    Things I've investigated:
    -Toggle off "Raycast target" on Graphics that are in front of my triggers (like a button's icon)
    -Putting buttons' icons on a different layer (like ignoreRaycast)
    -Making sure my Graphics Raycaster does not has blocking mask for those layers.
     
    Last edited: Oct 18, 2022