# ScreenToViewportPoint(Vector3)

> Transforms position from screen space into viewport space.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.5/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public Vector3 ScreenToViewportPoint(Vector3 position)
```

### Parameters

**** (\[Vector3]\(/engine/6000.5/script-reference/unityengine/vector3)):&#x20;

### Returns

| Type                                                              | Description |
| ----------------------------------------------------------------- | ----------- |
| [Vector3](/engine/6000.5/script-reference/unityengine/vector3.md) |             |

### Remarks

Screen space is defined in pixels. The bottom-left of the screen is (0,0); the right-top is ([Camera.pixelWidth](/engine/6000.5/script-reference/unityengine/camera/pixelwidth.md),[Camera.pixelHeight](/engine/6000.5/script-reference/unityengine/camera/pixelheight.md)). The z position is in world units from the camera.

Viewport space is normalized and relative to the camera. The bottom-left of the camera is (0,0); the top-right is (1,1). The z position is in world units from the camera.

### Examples

```csharp
using UnityEngine;

public class Example : MonoBehaviour
{
    void Update()
    {
        transform.position = Camera.main.ScreenToViewportPoint(Input.mousePosition);
    }
}
```
