natiny.entity.get_scale
Lua
natiny.entity.get_scale(node) -> sx, sy, sz
Returns the scale factors of a node, as three separate numbers.
Parameters
| Name |
Type |
Description |
node |
number |
Entity handle (e.g. model, pivot, body, sound source or camera) |
Returns
| Type |
Description |
number |
Scale factor along X |
number |
Scale factor along Y |
number |
Scale factor along Z |
Example
Lua
local sx, sy, sz = natiny.entity.get_scale(cube)
natiny.entity.set_scale(cube, sx * 1.1, sy * 1.1, sz * 1.1)
Notes
- There is no
space argument because
natiny.entity.set_scale has none: this returns exactly the
three numbers that were written. A node under a scaled parent is drawn
scaled without its own three changing.
- A node that was never scaled returns
1, 1, 1, and so does a handle that is
not a live node.