natiny.entity.set_position

Lua
natiny.entity.set_position(node, space, x, y, z)

Sets the position of a node in the given coordinate space.

Parameters

Name Type Description
node number Entity handle (e.g. model, body, sound source or camera)
space integer natiny.entity.SPACE_LOCAL or natiny.entity.SPACE_WORLD
x number Position X
y number Position Y
z number Position Z

Example

Lua
natiny.entity.set_position(node, natiny.entity.SPACE_WORLD, 2.0, 0.0, -5.0)

Notes

  • SPACE_LOCAL sets the stored parent-relative position. SPACE_WORLD converts an absolute world position into parent space.
  • The world conversion assumes a parent with unit scale; with a scaled parent, the resulting world position is not exact.