Skip to content

Latest commit

 

History

History
35 lines (22 loc) · 1.43 KB

File metadata and controls

35 lines (22 loc) · 1.43 KB
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();
    }