self:unproject_position
Client
Retrieves the screen-space position corresponding to a world-space point
Syntax
local result = self:unproject_position(
position
)Parameters
| Type | Name | Description |
|---|---|---|
vector3 | position | Position in world space |
Returns
| Type | Name | Description |
|---|---|---|
vector2 | result | Screen-space position in pixels corresponding to the given world-space point |
Examples
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))