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_name | type | description |
|---|---|---|
| index | number | The index of the touch point. |
return
| type | description |
|---|---|
Touch | The touch information. |
code example
typescript
OnUpdate(): void {
if (Input.touchCount > 0) {
let touch = Input.GetTouch(0);
}
}