natiny.entity.set_position
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
natiny.entity.set_position(node, natiny.entity.SPACE_WORLD, 2.0, 0.0, -5.0)
Notes
SPACE_LOCALsets the stored parent-relative position.SPACE_WORLDconverts 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.