Why my pointer events keep triggering 3 times all the time???

Hello everyone i’m having a really odd problem and i really do need some help or tips . So i followed a video of VR pointer where I try to override the input as following :

 public class VRInput : BaseInput 
     {
         public Camera eventCamera = null;
         public SteamVR_Input_Sources m_TargetSource;
         public SteamVR_Action_Boolean m_ClickAction;
         public PhysicsPointer m_PhysicsPointer = null;
     
         protected override void Awake()
         {
             GetComponent<BaseInputModule>().inputOverride = this;
         }
         public override bool mousePresent
         {
             get
             {
                 return true;
             }
         }
     
         public override bool GetMouseButton(int button)
         {
             return m_ClickAction.GetState(m_TargetSource);
         }
         public override bool GetMouseButtonDown(int button)
         {
             return m_ClickAction.GetStateDown(m_TargetSource);
         }
         public override bool GetMouseButtonUp(int button)
         {
             return m_ClickAction.GetStateUp(m_TargetSource);
         }
         public override Vector2 mousePosition
         {
             get
             {
                 Vector3 screenPos = eventCamera.WorldToScreenPoint(m_PhysicsPointer.GetDotPosition());   
                 return new Vector2(screenPos.x, screenPos.y);
             }
         }
     }

and after this change of inputOverride, when I try to invoke a onpointerdown event, like :

 public void OnPointerDown(PointerEventData eventData)
     {
         Debug.Log("OnPointerdonw");
     }

after a single pointerdown action(in my case pushing a button on my htc vive controller), I’ll get 3 “OnpointerDown” messages and I have no idea why I’m having that .

Any help or ideas about where it comes the problems are greatly appreciated!

i just figured out the problem is from the override bool getmouseButton(int button) , since in the override , i didn’t specify the value of button, it’s done for all 3 button of the mouse. that’s why i had 3 times of pointer donw messages all the time after one single action on the controller. If ever someone else had or will have those kind of problems i hope this post will help :slight_smile: