Skip to content

WorldToScreen

Read worldtoscreen from the current render or game view.

WorldToScreen(worldPosition)

Inputs: worldPosition is a world { x, y, z } value.

Output: Screen Vector2, or nil when the view or projection is unavailable.

Errors and unavailable states: Returns nil if the view is unavailable, projection is non-finite, or during a capture-only pass. A non-table position can raise a Lua indexing error; missing or non-numeric coordinates read as 0.

See Rendering overview for coordinate and color conventions.