Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Detecting if the mouse is over UI elements

Discussion in 'UI Toolkit' started by jorisshh, May 1, 2020.

  1. jorisshh

    jorisshh

    Joined:
    Oct 6, 2009
    Posts:
    1,522
    Hi,

    I'd like to disable my character controller whenever the player is hovering over a UI element. Is there an easy way to do this?

    I found some suggestions about adding a MouseEnterEvent, however, this can get very messy and is easy to forget. Is there an equivalent of the GraphicsRaycaster in the UI toolkit?