Search Unity

Left or right click mouse binding not working?

Discussion in 'Input System' started by Pixitales, Feb 25, 2022.

  1. Pixitales

    Pixitales

    Joined:
    Oct 24, 2018
    Posts:
    227
    Dont know why my mouse click not working while other binding on my keyboard works. I set action type to Button and set interaction to press only. I have my Player Input component and such... Maybe my mouse broken for new input system? Not even Mouse.current is working.

    Code (CSharp):
    1.     private InputControls inputControls;
    2.  
    3.     private void Awake()
    4.     {
    5.         inputControls = new InputControls();
    6.         inputControls.Player.LeftClick.performed += context => Debug.Log("It works");
    7.  
    8.     }
    9.  
    10.     private void OnEnable() => inputControls.Enable();
    11.     private void OnDisable() => inputControls.Disable();
     
    Last edited: Feb 25, 2022
  2. Pixitales

    Pixitales

    Joined:
    Oct 24, 2018
    Posts:
    227
    so the mouse work on my other project but just not the one im working on. My mouse keep saying null... I guess i have to start a new project