Start a new topic

Get event for pinching and un pinching

Hello,  I was wondering how can i get the events for pinching and un pinching in unity, right now i can do it with mapping enter select and exit select, but i want it to work in general even if i am not on UI.


Hi Ahmed,


You can access them via Unity's input system - Here some sample code for the left hand pinch:


    [SerializeField] private InputActionProperty _leftHandPinch;

    private void OnEnable()
    {
        _leftHandPinch.EnableDirectAction();
    }

    private void OnDisable()
    {
        _leftHandPinch.DisableDirectAction();
    }

    private void Start()
    {
        _leftHandPinch.action.performed += LeftHandPinchPerformed;
    }

    private void LeftHandPinchPerformed(InputAction.CallbackContext obj)
    {
        Debug.Log("Left hand PINCHED");
    }


The corresponding input actions to assign in the editor are 

  • triggerPressed [LeftHand Qualcomm Hand]
  • triggerPressed [RightHand Qualcomm Hand]

and for grabbing

  • grip [LeftHand Qualcomm Hand]
  • grip [RightHand Qualcomm Hand]

1 person likes this

Thanks a lot Simon

Login to post a comment