natiny.entity.get_rotation

Lua
natiny.entity.get_rotation(node [, space]) -> rx, ry, rz

Returns the orientation of a node in degrees, as three separate numbers.

Parameters

Name Type Default Description
node number Entity handle (e.g. model, pivot, body, sound source or camera)
space integer natiny.entity.SPACE_WORLD natiny.entity.SPACE_LOCAL or natiny.entity.SPACE_WORLD

Returns

Type Description
number Rotation around X, in degrees
number Rotation around Y, in degrees
number Rotation around Z, in degrees

Example

Lua
local _, yaw = natiny.entity.get_rotation(turret, natiny.entity.SPACE_WORLD)
natiny.entity.set_rotation(barrel, natiny.entity.SPACE_WORLD, 0, yaw, 0)