UnityRef is currently in early development. Some features may be incomplete and/or not functioning.

UNITYREF

Your Pit Stop For Solving ANYTHING in Unity

architecture

[Input System] How to Disable Multi-Touch in Unity 6

Solution

inputmobilemobile developmentuser experience

Unity 2020.3.x - Unity 6.3.x

Published Fri, Mar 27

Issue

 Projects transitioning to the Input System package often find that Input.multiTouchEnabled no longer functions. The Single Unified Pointer setting within the InputSystemUIInputModule only restricts interactions with the Canvas, leaving gameplay logic vulnerable to receiving multiple simultaneous touch points that can break mechanics.

Quick-Fix

The Input System does not have a global toggle to disable multi-touch. Developers must use EnhancedTouchSupport to manually filter the activeTouches array, ensuring only the first finger index is processed by your input processor script.

Expand Analysis

The Input System requires a manual approach to filter touch indices because it lacks a global property for disabling multi-touch. By utilizing the EnhancedTouch namespace, you can monitor the activeTouches count and ignore any input where the finger index is not zero.

  1. Initialize EnhancedTouchSupport in your script’s OnEnable method.
  2. Access the activeTouches collection within your update loop or event callback.
  3. Implement a check to only execute logic if the touch being processed is the first element in activeTouches.
  4. Disable the support in OnDisable to maintain clean state management.

Additional Tips:

  • The Single Unified Pointer behavior only consolidates UI events; it does not filter the raw activeTouches data.
  • Using Touch.activeTouches[0] is the most reliable way to ensure you are always tracking the initial finger that contacted the screen.

Copy


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

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

    void Update()
    {
        if (Touch.activeTouches.Count > 0)
        {
            // Only process the first finger (index 0) to simulate disabled multi-touch
            var primaryTouch = Touch.activeTouches[0];
            Debug.Log($"Finger {primaryTouch.touchId} is at {primaryTouch.screenPosition}");
        }
    }

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

Related Posts Haven't quite found a solution to your problem? We think these posts might help you.

Content inspired by a Unity discussion post.