Files
Test/Library/PackageCache/com.unity.inputsystem@2436e68c60c4/Documentation~/simulate-touch-input.md
T
2026-11-01 23:39:55 +02:00

1.4 KiB

uid
uid
input-system-simulate-touch

Simulate touches

You can simulate touch input from pointer devices such as mouse and pen devices in the following ways:

Enable touch simulation in the Unity Editor

To enable touch simulation in the Unity Editor, perform the following steps:

  1. Open the Input Debugger (Window > Analysis > Input Debugger)
  2. Select the Options dropdown, and enable Simulate Touch Input From Mouse or Pen.

Add touch simulation to a GameObject

Add the TouchSimulation MonoBehaviour to a GameObject in your scene. TouchSimulation adds a Touchscreen device and automatically mirrors input on any Pointer device to the virtual touchscreen device.

Enable touch simulation in startup code

Call TouchSimulation.Enable somewhere in your startup code:


   void OnEnable()
    {
        TouchSimulation.Enable();
    }