Unity - Scripting API: HandleUtility.WorldToGUIPoint
Success!
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Submission failed
For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Parameters
| Parameter | Description |
|---|---|
| world | Point in world space. |
Description
Convert a world space point to a 2D GUI position..
Uses the current camera to calculate the projection. Returns GUI x/y and view-space z. Use this to place editor GUI elements based on world positions.
If the world point is outside the camera's frustrum, WorldToGUIPoint returns x/y coordinates that might be outside the SceneView’s pixel rect and a positive z value.
If the world point is behind the camera, it returns a Vector3 with a negative z component.
Additional resources: GUIPointToWorldRay, RaySnap.