self:unproject_position

Client

Retrieves the screen-space position corresponding to a world-space point


Syntax

local result = self:unproject_position(
    position
)

Parameters

TypeNameDescription
vector3positionPosition in world space

Returns

TypeNameDescription
vector2resultScreen-space position in pixels corresponding to the given world-space point

Examples

Convert a world position to screen space
local entity = core.camera.create()

entity:set_active()

local screen_position = entity:unproject_position({0, 0, -5})

core.engine.print("info", "Screen position:", util.table.unpack(screen_position))

On this page