Search Unity

Question Good way to set Raycast Bounds for Graphics Raycaster

Discussion in 'UGUI & TextMesh Pro' started by crazyjackel, Mar 20, 2021.

  1. crazyjackel

    crazyjackel

    Joined:
    Oct 10, 2018
    Posts:
    18
    So, I am working on an inventory system using UI elements. I am using the event system and the IPointerEnter and IPointerExit handlers to try and detect when the pointer enters and exits. One of the issues that I am trying to figure out how to set the bounds for IPointerEnter and IPointerExit, so that they aren't reliant on the Images' Pixel Adjusted Bounds. Currently, I am using the bounds from marking the image as a raycast target, but different image sizes can cause issues with selection. I was wondering if there is any easy way to add a script or behavior so that I can setup the bounds for the graphics raycaster.

    I am not good at explaining things, so let me know if you need more information or clarification.