ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client functions
  3. isWorldPointVisible

Function

isWorldPointVisible

ClientDrawing (dx)Trilogy Hub only

Checks whether a world point is on screen and not hidden by a building or terrain. Occlusion is checked in the background, so the result for a new point arrives after a moment. For 3D labels and markers that should not show through walls.

Syntax

bool isWorldPointVisible(float x, y, z)

Arguments

x, y, zfloat
The point.

Returns

true when the point is visible.

Example

addEventHandler("onClientRender", root, function()
    local x, y, z = 2495, -1687, 15
    if isWorldPointVisible(x, y, z) then
        local sx, sy = getScreenFromWorldPosition(x, y, z)
        if sx then dxDrawText("Grove Street", sx, sy) end
    end
end)

Notes

Occlusion in the background. You do not need processLineOfSight every frame; the game computes occlusion in the background.

See also