unity c# get the object of the ui your mouse is over code example Example: unity Check if mouse clicked UI element EventSystem.current.IsPointerOverGameObject()