Skip to content

format

typescript
Touch.position

class: 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_nametypedescription

reture

typedescription
Vector2The position of the touch relative to the screen.

code example

javascript
const touch = Input.GetTouch(0);
const position = touch.position;