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

Question New Input system and click propagation

Discussion in 'Input System' started by khan-amil, Aug 6, 2020.

  1. khan-amil

    khan-amil

    Joined:
    Mar 29, 2012
    Posts:
    206
    Is there a way using the new input system and mouse click input to prevent said input if we're over UI?

    Basically check for EventSystem.current.IsPointerOverGameObject() before actually processing the input.

    From what I understand of the system the only way I see is to check in each action implementation using click that we're actually processing a mouse click (from the path in the CallbackContext), and then check if the mouse is over UI.

    That would work but if you want to have rebindable inputs you'll have to do that for each action, instead of tying it to the input definition itself.