architecture
[Input System] How to Disable Multi-Touch in Unity 6
Solution
Unity 2020.3.x - Unity 6.3.x
Published Fri, Mar 27
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.
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.
[Key Press] Stop Input.GetKeyDown Double Triggers[Input System] UI Buttons Unresponsive with Simulator Tab Open[UI Toolkit] Fix Keyboard/Gamepad Button Interaction on Submit
Content inspired by a Unity discussion post.