natiny.entity.get_position
Lua
natiny.entity.get_position(node [, space]) -> x, y, z
Returns the position of a node in the given coordinate space, as three
separate numbers.
Parameters
| Name |
Type |
Default |
Description |
node |
number |
|
Entity handle (e.g. model, body, sound source or camera) |
space |
integer |
natiny.entity.SPACE_WORLD |
natiny.entity.SPACE_LOCAL or natiny.entity.SPACE_WORLD |
Returns
| Type |
Description |
number |
Position X |
number |
Position Y |
number |
Position Z |
Example
Lua
local x, y, z = natiny.entity.get_position(player, natiny.entity.SPACE_WORLD)
natiny.entity.set_position(camera, natiny.entity.SPACE_WORLD, x, y + 1.7, z)