Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct here to familiarize yourself with the rules and how to post constructively.

  2. Unity 2022.1 is now available as the latest Tech release.
    Dismiss Notice
  3. Improve your project's performance with our new guide on profiling in Unity.
    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?
     
unityunity