Skip to main content
2 of 3
added 5 characters in body
Morten
  • 616
  • 5
  • 12

One way is to access the InputSystem more directly.

You might be looking for TouchPhase or use the Finger combined with the EnhancedTouch.

using UnityEngine;
using UnityEngine.InputSystem.EnhancedTouch;
using Touch = UnityEngine.InputSystem.EnhancedTouch.Touch;

public class TouchDemo : MonoBehaviour
{
    private void OnEnable()
    {
        EnhancedTouchSupport.Enable();
    }

    private void OnDisable()
    {
        EnhancedTouchSupport.Disable();
    }

    private void Update()
    {
        foreach (var touch in Touch.activeTouches)
        {
            // Only respond to first finger
            if (touch.finger.index == 0 && touch.inProgress)
            {
                // TODO
            }
        }
    }
}
```
Morten
  • 616
  • 5
  • 12