natiny.entity.move

Lua
natiny.entity.move(node, space, dx, dy, dz)

Moves a node by a delta offset 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
dx number Offset along X axis
dy number Offset along Y axis
dz number Offset along Z axis

Example

Lua
natiny.entity.move(node, natiny.entity.SPACE_LOCAL, 0.0, 0.0, -1.0)

Notes

  • SPACE_LOCAL rotates the delta by the node's local orientation before adding it. SPACE_WORLD interprets the delta along world axes.
  • World-space conversion assumes a parent with unit scale. With a scaled parent, the resulting world displacement is not exact.