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
and for grabbing
Thanks a lot Simon
Ahmed Tayseer
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.