Skip to content

format

typescript
Camera.ScreenPointToViewport(point)

class: Camera

description

Converts the screen coordinates of the current camera to viewport coordinates.

parameter

param_nametypedescription
pointVector3Screen coordinates.

reture

typedescription
Vector3The converted viewport coordinates.

code example

typescript
let camera = this.gameObject.GetComponent<Camera>(Camera);
camera.ScreenToViewportPoint(new Vector3(1,1,1));