Search Unity

Question 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:
    29
    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-Unity

    HugoBD-Unity

    Unity Technologies

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

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