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

Make button ignore right mouse button?

Discussion in 'UGUI & TextMesh Pro' started by madruytb, Oct 20, 2021.

  1. madruytb

    madruytb

    Joined:
    May 10, 2018
    Posts:
    26
    So I'm making a click anywhere to continue button for dialogue and while at it I want the player to be able to reposition the camera while holding RMB + drag, but as the button covers the whole screen it seems it blocks the right mouse input.

    I think, but not sure, that instead of using the button component I would have to create a script with a

    Code (CSharp):
    1. public virtual void OnPointerClick(PointerEventData eventData)
    2.     {
    3.         if (eventData.button == PointerEventData.InputButton.Left)
    4.         {
    5.             //Click to continue function here.
    6.         }
    7. }
    Guess i'm missing something?