Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


WorldToGUIPointWithDepth

Convert a world space point to a 2D GUI position.
Read time 1 minuteLast updated 10 days ago

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor.CoreModule

WorldToGUIPointWithDepth(Vector3)

Convert a world space point to a 2D GUI position.
public static Vector3 WorldToGUIPointWithDepth(Vector3 world)

Parameters

world

Point in world space.

Returns

Type

Description

Vector3A 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.

WorldToGUIPointWithDepth(Camera, Vector3)

Convert a world space point to a 2D GUI position.
public static Vector3 WorldToGUIPointWithDepth(Camera camera, Vector3 world)

Parameters

camera


world

Point in world space.

Returns

Type

Description

Vector3A 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.