Skip to content

format

typescript
Input.GetTouch(index)

class: Input

description

Get the status and position information of the specified touch point on the touch screen.

The index of the touch point starts from 0. If you need to get information for multiple touch points, you can loop through the GetTouch method and specify different indexes.

parameter

param_nametypedescription
indexnumberThe index of the touch point.

return

typedescription
TouchThe touch information.

code example

typescript
OnUpdate(): void {

    if (Input.touchCount > 0) {
           
        let touch = Input.GetTouch(0);
        
    }
}