# WorldToGUIPointWithDepth

> Convert a world space point to a 2D GUI position.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.6/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

## WorldToGUIPointWithDepth(Vector3)

Convert a world space point to a 2D GUI position.

```csharp
public static Vector3 WorldToGUIPointWithDepth(Vector3 world)
```

### Parameters

**** (\[Vector3]\(/engine/6000.6/script-reference/unityengine/vector3)): Point in world space.

### Returns

| Type                                                              | Description                                                                                                                   |
| ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| [Vector3](/engine/6000.6/script-reference/unityengine/vector3.md) | A Vector3 where the x and y values relate to the 2D GUI position. The z value is the distance in world units from the camera. |

### Remarks

Uses the current camera to calculate the projection.

Additional Resources: [HandleUtility.WorldToGUIPoint](/engine/6000.6/script-reference/unityeditor/handleutility/worldtoguipoint.md). [HandleUtility.GUIPointToWorldRay](/engine/6000.6/script-reference/unityeditor/handleutility/guipointtoworldray.md), [HandleUtility.RaySnap](/engine/6000.6/script-reference/unityeditor/handleutility/raysnap.md).

## WorldToGUIPointWithDepth(Camera, Vector3)

Convert a world space point to a 2D GUI position.

```csharp
public static Vector3 WorldToGUIPointWithDepth(Camera camera, Vector3 world)
```

### Parameters

**** (\[Camera]\(/engine/6000.6/script-reference/unityengine/camera)): **** (\[Vector3]\(/engine/6000.6/script-reference/unityengine/vector3)): Point in world space.

### Returns

| Type                                                              | Description                                                                                                                   |
| ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| [Vector3](/engine/6000.6/script-reference/unityengine/vector3.md) | A Vector3 where the x and y values relate to the 2D GUI position. The z value is the distance in world units from the camera. |

### Remarks

Uses the current camera to calculate the projection.

Additional Resources: [HandleUtility.WorldToGUIPoint](/engine/6000.6/script-reference/unityeditor/handleutility/worldtoguipoint.md). [HandleUtility.GUIPointToWorldRay](/engine/6000.6/script-reference/unityeditor/handleutility/guipointtoworldray.md), [HandleUtility.RaySnap](/engine/6000.6/script-reference/unityeditor/handleutility/raysnap.md).
