The information on this page may no longer be accurate. To see the latest, go to our new and improved documentation. You can also learn more about the future of documentation.
Collapse Sidebar


This function returns the screen location and depth of a DataType/Vector3 worldPoint and whether this point is visible on the screen or not.

In-game example

This function takes in account the current GUI inset (such as the space occupied by the top bar). This means the 2D position returned is in the same term as GUI positions and can be used to place GUI elements. For an otherwise identical function that ignores the GUI inset, see Camera/WorldToViewportPoint.

For example:

local camera = workspace.CurrentCamera
local worldPoint = Vector3.new(0, 10, 0)
local vector, onScreen = camera:WorldToScreenPoint(worldPoint)

local screenPoint = Vector2.new(vector.X, vector.Y)
local depth = vector.Z

Note this function does not perform any raycasting, meaning the visible bool will be true regardless if the worldPoint is obscured by BasePart|BaseParts or Terrain.


Name Type Default Description

The DataType/Vector3 world position


Return Type Summary

A tuple containing, in order:

A DataType/Vector3 whose X and Y components represent the offset of the worldPoint from the top left corner of the screen, in pixels. The DataType/Vector3|Vector3’s Z component represents the depth of the worldPoint from the screen (in studs).

A bool indicating if the worldPoint is within the bounds of the screen