format
typescript
Touch.positionclass: Touch
description
(Read Only) The current position of the touch point relative to the screen.
This method is mainly used to get the current position of a touch event, so that corresponding actions can be performed based on the touch point's position. It is commonly used to implement interactive behaviors on touch screens, such as tapping, dragging, and swiping.
parameter
| param_name | type | description |
|---|
reture
| type | description |
|---|---|
Vector2 | The position of the touch relative to the screen. |
code example
javascript
const touch = Input.GetTouch(0);
const position = touch.position;