Search Unity

Help Wanted How to determine the element directly under the pointer

Discussion in 'UI Toolkit' started by CoryMaklin, Sep 27, 2021.

  1. CoryMaklin

    CoryMaklin

    Joined:
    Oct 10, 2020
    Posts:
    28
    Is there an equivalent GraphicRaycaster component for UI Documents?
    I'm using multiple UI documents and I need to determine whether the mouse is over a given panel.
     
  2. hugobd

    hugobd

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    123
    Hi @CoryMaklin ,

    Would registering a callback on MouseOver do the trick? Something like this :
    visualElement.RegisterCallback<MouseOverEvent>((evt => { }));
     
unityunity